5 ms·
Huh. So Haskell is the language of the missing apostrophe instead of the missing semicolon. (In all fairness, so is Lisp, but it puts the apostrophes on the oth
by i336_ 9y ago
Huh. So Haskell is the language of the missing apostrophe instead of the missing semicolon. (In all fairness, so is Lisp, but it puts the apostrophes on the other side.)
I'm curious about "(zip urls response" though. Does that extend to the "responseInfos)" on the next line, or am I reading it wrong?
(I noticed the "fmap fst" and "fmap snd".)
Wonders where to start to figure out how this works
- codygman 9y agoYep, I've missed apostrophe's quite a few times. It's was a common cause of infinite loops for me in the past, but I suppose I've trained myself to spot them more quickly. Perhaps zip can be more simply explained by a simple example: out: zip ["a","b","c"] [0,1,2] out: [("a",0),("b",1),("c",2)] out: fmap fst [(0,1),(2,3),(4,5)] out: [0,2,4] out: fmap snd [(0,1),(2,3),(4,5)] out: [1,3,5]
- i336_ 9y agoOhhhhh. zip is cool! And I wondered whether "fst" was "first" and "snd" was "second"... is there a "trd" and "fth"? Also - is [] a list (or mixed type) and () an array (or same-item type)?
- dllthomas 9y agoHopefully the ticked version is a different type than the unticked version and would be caught by the typechecker. Failing that, hopefully the ticked version is now unused and will be caught by the linter. But yeah, this is definitely a thing that can happen. If you're doing a lot of successive transformations of data of the same type, putting it in State will prevent you from messing up the ordering (or needing to come up with fresh names).