Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lexi-lambda
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
lexi-lambda
7y ago
I think it’s fantastic that Elm works well for you; it’s a wonderful language and there’s no doubt that it is much simpler than Haskell. I agree with you that, in many cases, the technique you’re describing is sufficient, and it requires mu
32.
▲
by
lexi-lambda
7y ago
TypeScript is sadly very unsound by design, so doing this kind of thing in TypeScript is always going to be more “best effort” and less “exhaustive proof.” That’s not necessarily wrong or bad per se , as after all, Haskell has escape hatch
33.
▲
by
lexi-lambda
7y ago
The idea really is that parsing subsumes validation. If you’re parsing, you don’t have to validate, because validation is a natural side-effect of the parsing process. And indeed, I think that’s the very thesis of the blog post: parsing is
34.
▲
by
lexi-lambda
7y ago
I have provided a translation of the NonEmpty datatype into Java in this comment: https://news.ycombinator.com/item?id=21478322 However, to answer your “why” question: mostly just because I write Haskell for a living, and m
35.
▲
by
lexi-lambda
7y ago
I think this is a reasonable point, and your split() example is a good one. I wasn’t sure while I was writing the blog post if I considered isomorphisms to be parsers, and I’m still not entirely sure if I do or not, but there’s an argument
36.
▲
by
lexi-lambda
7y ago
> You also seem to have missed the point of the Java example anyway, in a misses-the-forest-for-the-trees way. Perhaps I did, yes. I do think the kind of thing you’re describing is valuable, to be clear. A lot of my comment was intended
37.
▲
by
lexi-lambda
7y ago
> But the type itself doesn't say that it must return the first element. Sure, I didn’t say it does. That type isn’t a full specification of head. This blog post isn’t about proving literally everything in your program correct, whic
38.
▲
by
lexi-lambda
7y ago
See my other comment about this question here: https://news.ycombinator.com/item?id=21478427
39.
▲
by
lexi-lambda
7y ago
> Still no static types for "Strings that end with a dot" or "Strings that match [a-z]+" Sure there are. :) Technically speaking, anyway. Here’s a type for “strings that end with a dot”: -- | A string that ends in
40.
▲
by
lexi-lambda
7y ago
What you’re describe is in a similar vein to what is described in my blog post, and it’s often absolutely a good idea, but it isn’t quite the same as what the post is about. Something like NameType attaches a semantic label to the data, but
41.
▲
by
lexi-lambda
9y ago
It isn’t broken in lts-10.5, it just isn’t in lts-10 at all. Go to https://www.stackage.org/lts-10.5 and search for ghc-mod—it just isn’t currently available. Unfortunately, the reason for this is that ghc-mod still isn’t u
42.
▲
by
lexi-lambda
12y ago
Yeah, I'm quite willing to admit that point-free style seems to often be more harmful than helpful. The comments on r/haskell also pointed out ($) as an operator of possible over-use, which I think makes sense. I just don't w
43.
▲
by
lexi-lambda
12y ago
This conversation got really out of hand really quickly, so I've stayed out of it, but is Alexis really male-preferred? That's an honest question; I don't know. Wolfram Alpha seems to find the opposite. http://www.
44.
▲
by
lexi-lambda
12y ago
Eh, you're right, that came off as far too aggressive—I didn't really mean it to be. Of course the OP isn't going to be omnipotent, but then why default to male? I know English doesn't have singular gender-neutral pronou
45.
▲
by
lexi-lambda
12y ago
You're going to spend all that work using "the author" everywhere and still manage to get my gender wrong ("his")? Okay. I don't really expect any different in this field, but just noting that. Anyway, I'm
46.
▲
by
lexi-lambda
12y ago
Yep, I posted this on r/haskell and someone pointed this out, which is cool. The provided type for Peg didn't derive Enum or Bounded, but it's a good trick to know.
47.
▲
by
lexi-lambda
12y ago
Ah, no, I probably wouldn't do it any simpler in Racket. Racket tends to de-emphasize more complicated function composition, which tends to serve it just fine. I've always adopted a somewhat pro-functional approach in my usage of
48.
▲
by
lexi-lambda
12y ago
Yep, that was the inspiration for this. :) I actually linked to it in the short intro bit at the beginning.
49.
▲
by
lexi-lambda
12y ago
I'm curious what conclusions you'd say those are... and if they're good or bad conclusions? That said, I'm sure I'm totally influenced by various languages I've tried in the past. And FWIW, Racket was also plen
50.
▲
Learning Haskell – A Racket programmer's foray into the land of Haskell
(lexi-lambda.github.io)
132 points
by
lexi-lambda
12y ago
|
94 comments