kowainik / slist

♾️ Sized list
https://kowainik.github.io/projects/slist
Mozilla Public License 2.0
46 stars 6 forks source link

Add `mapMaybe` #29

Closed vrom911 closed 3 years ago

chshersh commented 4 years ago

As a separate function, I often want to map over some structure with a Maybe-like function and return a Slist. For example, sometimes I want to have the following function:

slistWith :: (a -> Maybe b) -> [a] -> Slist b

So I get a proper Slist in a single traversal.