The latest version of generic-maybe is 0.3.0.4-0.
generic-maybe
Version 0.3.0.3 revision 0 uploaded by JonathanFischoff.
Package meta
- Synopsis
- A generic version of Data.Maybe
- Description
This module is a drop in replacement for Data.Maybe. It generalizes the functions to any types that share the same "sum of products" view of Maybe.
To use the module for your type, enable GHC's DeriveGeneric extension and derive a Generic instance for your type.
import GHC.Generics data Result a = Success a | Fail deriving (Show, Generic)
After which you can use the functions, like your type was Data.Maybe.Maybe
> fromMaybe 'a' Fail 'a'
> fromMaybe 'a' $ Success 'b' 'b'
- Author
- Jonathan Fischoff
- Bug reports
- n/a
- Category
- Generics
- Copyright
- n/a
- Homepage
- https://github.com/jfischoff/generic-maybe
- Maintainer
- jonathangfischoff@gmail.com
- Package URL
- n/a
- Stability
- n/a