3 ms·
I mean that `head` should be `List a -> Maybe a` rather than `List a -> a`. If you really really want an `a`, you should provide `NonEmptyList a` or something.
by tasuki 2y ago
I mean that `head` should be `List a -> Maybe a` rather than `List a -> a`. If you really really want an `a`, you should provide `NonEmptyList a` or something.
- tromp 2y agoHaskell provides https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-List-NonEmpty.html https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-...
- kreetx 2y agoI agree! The current `head` should be renamed `unsafeHead` (or something), and the new `head` should have the type you wrote.