3 ms·
There's already withDefault to make that concise, so you can do things like this: withDefault 0 (head listOfNumbers) No need to pattern match every time. :)
by rtfeldman 11y ago
There's already withDefault to make that concise, so you can do things like this:
withDefault 0 (head listOfNumbers)
No need to pattern match every time. :)
Docs for withDefault: http://package.elm-lang.org/packages/elm-lang/core/1.0.0/Maybe#withDefault http://package.elm-lang.org/packages/elm-lang/core/1.0.0/May...