[Haskell-cafe] Generalizing catMaybes

Henning Thielemann lemming at henning-thielemann.de
Sat Jan 8 12:06:33 CET 2011


On Sat, 8 Jan 2011, Roman Cheplyaka wrote:

> I think catMaybes deserves its own typeclass, which would represent
> "truncatable" structures:
>
>    class Truncatable struct where
>        catMaybes :: struct (Maybe a) -> Maybe a

But catMaybes has the type
   catMaybes :: struct (Maybe a) -> struct a
  for struct = []



More information about the Haskell-Cafe mailing list