type-fun-0.0.1: Collection of widely reimplemented type families

Safe HaskellNone
LanguageHaskell2010

TypeFun.Data.Maybe

Synopsis

Documentation

type family MaybeCase a nothing just :: r Source

Equations

MaybeCase Nothing nothing just = nothing 
MaybeCase (Just k) nothing just = just k 

type family NothingToConstr a c :: Constraint Source

Equations

NothingToConstr Nothing c = c 
NothingToConstr (Just a) c = () 

type family JustToConstr a c :: Constraint Source

Equations

JustToConstr Nothing c = () 
JustToConstr (Just a) c = c 

type family CatMaybes l :: [k] Source

Like catMaybes for type lists

Equations

CatMaybes `[]` = `[]` 
CatMaybes (Just a : as) = a : CatMaybes as 
CatMaybes (Nothing : as) = CatMaybes as 

type family FromJust a :: k Source

Equations

FromJust (Just a) = a