generic-maybe utilizes GHC.Generics to generalize the functions of Data.Maybe to arbitrary sum types with two constructors, with one "empty."
Here is a quick example:
ë> :set -XDeriveGeneric
ë> import GHC.Generics
ë> data Result a = Success a | Fail deriving (Show, Generic)
ë> fromMaybe 'a' Fail
'a'
ë> fromMaybe 'a' $ Success 'b'
'b'
Additionally, it lets you convert between two representations:
ë> convert (Just 'a') :: Result Char
Success 'a'
Documentation on Hackage:
-Jonathan Fischoff