purescript-nonempty icon indicating copy to clipboard operation
purescript-nonempty copied to clipboard

Add `last :: forall f a. NonEmpty f a -> a` ?

Open jerbaroo opened this issue 2 years ago • 2 comments

O(N)

jerbaroo avatar Jan 31 '24 11:01 jerbaroo

I don't think it's possible to implement that? You'd need a Foldable constraint on f or something like that.

garyb avatar Jan 31 '24 12:01 garyb

last :: forall f a. Foldable f => NonEmpty f a -> a would be useful.

jerbaroo avatar Jan 31 '24 12:01 jerbaroo