| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 22:11:01 GMT
X-Served-By: cache-dfw-kdfw8210094-DFW, cache-bom-vanm7210050-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768687861.011040,VS0,VE286
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
generic-maybe: A generic version of Data.Maybe
generic-maybe: A generic version of Data.Maybe
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'
Flags
Manual Flags
| Name | Description | Default |
|---|---|---|
| test-doctests | Enabled | |
| test-hlint | Enabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- generic-maybe-0.3.0.4.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.1.0, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.0.3, 0.3.0.4 |
|---|---|
| Dependencies | base (>=4.5 && <4.8), ghc-prim [details] |
| License | BSD-3-Clause |
| Author | Jonathan Fischoff |
| Maintainer | jonathangfischoff@gmail.com |
| Uploaded | by JonathanFischoff at 2014-02-13T17:01:55Z |
| Category | Generics |
| Home page | https://github.com/jfischoff/generic-maybe |
| Distributions | |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Downloads | 7688 total (35 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Successful builds reported [all 1 reports] |