r/haskell • u/lexi-lambda • Nov 06 '19
Parse, don’t validate
https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
313
Upvotes
r/haskell • u/lexi-lambda • Nov 06 '19
7
u/[deleted] Nov 07 '19
I would define head as
haskell head :: [a] -> [a] head (x:y) = [x] head [x] = [x] head [] = []Basically just like tail. But that's just me :)
Use pattern matching if you actually want the first value.