Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pka
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
34 ms
·
271.
▲
by
pka
11y ago
Pointer arithmetic is really not that hard. It's not something worthy to be proud of.
272.
▲
by
pka
11y ago
The need for type coercion is a very good indicator of a bad design. Haskell just forces you to deal with it right now instead of never.
273.
▲
by
pka
11y ago
So what is an easy algorithm then? Keep in mind, "newest update wins" doesn't even begin to cover all possible use cases.
274.
▲
by
pka
11y ago
First google result: https://wiki.haskell.org/Haskell_in_industry You'll probably recognize some companies, such as Facebook, Google, Microsoft.
275.
▲
by
pka
11y ago
Thanks, that's a cool approach! I'm wondering if a free monad approach would have any advantages over this.
276.
▲
by
pka
11y ago
Could you elaborate more or point to some sample code?
277.
▲
by
pka
11y ago
Looks great, thanks!
278.
▲
by
pka
11y ago
True. Damn progress :(
279.
▲
by
pka
11y ago
Oh, yeah - something like QuickCheck [0] is great! There are Java and C++ implementations as well, though I haven't tried them. Definitely a nice alternative to traditional unit testing whenever possible. I don't know how well it
280.
▲
by
pka
11y ago
Well, this is basically what types are :)
281.
▲
by
pka
11y ago
Yes, a type system is very much going to help you, even if you have that skill of "capturing implicit state". Because then a function you call, written by somebody else without that skill, may rely on global state in unexpected wa
282.
▲
by
pka
11y ago
In addition to what the others said, I'd much rather prefer good static typing (i.e. Haskell). Especially in the prototyping phase, I do a lot of iterating and refactoring - and I mean A LOT, because I've found that this is the be
283.
▲
by
pka
11y ago
Can't break be simulated by something like MaybeT? And forWithBreakM :: [a] -> (a -> m (Maybe b)) -> m [b] that stops when f yields Nothing? (isn't this actually sequence . forM?)
284.
▲
by
pka
11y ago
I want to respond to one point specifically: `Private ecosystem — if all your code is in X, you have potentially tons of reusable modules as part of your own stack.` Never ever in my OOP days have I been able to reuse a non-trivial function
285.
▲
by
pka
11y ago
More likely, your "type B" programmer will build a half-assed MVP with 20% of the initial features that will break every 5 seconds and thus the "million dollars paying startup" will lose their customers to the saner comp
286.
▲
by
pka
11y ago
I agree - I really had to deobfuscate / parse the signature first before even being able to start comprehending what it is about. Not saying that there are no monster type signatures in Haskell (just recovering from one such instance i
287.
▲
by
pka
11y ago
I thought "Extension" in this example is a Monoid. So maybe foldContramap? :)
288.
▲
by
pka
11y ago
Is this foldMap :: Monoid m => (a -> m) -> t a -> m ?
289.
▲
by
pka
11y ago
Well, you can write if 5 < x < 6 for one! Sorry for the sarcasm, but the author hasn't given a single reason beyond some trivial (and inconsequential, imo) syntactic shortcuts and his personal preference for the language.
290.
▲
PureScript for the Haskeller
(arow.info)
2 points
by
pka
11y ago
|
0 comments
291.
▲
by
pka
11y ago
Another alternative would be to use a language without runtime exceptions, like Elm or PureScript.
292.
▲
by
pka
11y ago
What's cool about monads is that the computation (assembly code in this particular case) is just a plain old value. So if you have a fragment like this: factorial :: Int64 -> X86 () factorial n = do mov rcx (I n)
293.
▲
by
pka
11y ago
Very interesting, thanks!
294.
▲
by
pka
11y ago
I moved from Elm to PureScript 1 month ago, and I don't regret it. Here's my earlier explanation why [0]. [0] https://news.ycombinator.com/item?id=10727009
295.
▲
by
pka
11y ago
If you already know the website. If you don't care about C++ or this guy's blog you will have wasted your time.
296.
▲
by
pka
11y ago
How did you handle refactorings? Like, changing userAddress's "type" from Address to Maybe Address? This is what scares me the most in Clojure and all other dynamic languages - that early on in the project, I'd make an u
297.
▲
by
pka
11y ago
One more thing that just made my life easier: Purescript recently got generic deriving [0], which means that one can derive Eq, Ord, JSON etc instances easily now! [0] https://github.com/purescript/purescript-generics
298.
▲
by
pka
11y ago
Evan Czaplicki was actually hired by Prezi to work exclusively on Elm, so the project has industry backing.
299.
▲
by
pka
11y ago
I've had a similar experience. I was ok with it though, because the pure data -> DOM nature of Elm's architecture was better than anything else. Until I found PureScript. Especially purescript-halogen [0], which is basically ho
300.
▲
by
pka
11y ago
While I agree - this particular alternative is worse - it's not the only alternative. I was talking about more expressive type systems, not less.
More ›