I have a function defined
maybeToList :: (a -> Maybe a) -> a -> [a] maybeToList f x = x : maybe [] (maybeToList f) (f x) This function seems so obvious that I can't believe it is not standard. Is it defined in some module (I already checked Data.Maybe)?
maybeToListis not the best name, considering that there is already a function with that name inData.Maybe, namelymaybeToList = maybe [] (:[]).unfoldStreamor something maybe?