4 ms·
They did. The elm-style version is in the standard libraries as: listToMaybe :: [a] -> Maybe a (http://hackage.haskell.org/package/base-4.11.1.0/docs/Dat
by lodi 8y ago
They did. The elm-style version is in the standard libraries as:
listToMaybe :: [a] -> Maybe a
(http://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Maybe.html#v:listToMaybe http://hackage.haskell.org/package/base-4.11.1.0/docs/Data-M...)
- galaxyLogic 8y agoThat's a lengthy name for the simple operation of getting the first element of a list if there is one. I would have preferred 'car' :-)
- lodi 8y agoIt's a bit verbose, but this kind of thing is far less prevalent in Haskell anyway; most of the time you destructure a list through pattern matching, not explicit head/tail functions.