<div dir="ltr">Hi,<div><br></div><div>today I was a bit surprised that apparently there is no easy way how to safely get the head element of `Seq` in a point-free way. Of course there is `viewl`, but it seems the data type has no folding function (something like 'foldViewL :: b -> (a -> Seq a -> b) -> b`.</div><div><br></div><div>Is there any existing function like `Seq a -> Maybe a` to safely retrieve the head (or last) element?</div><div><br></div><div>If not, I'd suggest to add</div><div><br></div><div>    headMaybe :: (Foldable t) => t a -> Maybe a</div><div>    headMaybe = getFirst . foldMap (First . Just)</div><div><br></div><div>and similarly lastMaybe to Data.Foldable.</div><div><br></div><div>  Thanks,</div><div>  Petr</div></div>