module Data.Yoko.MaybeKind
(
Nothing, Just,
IsJust, MaybePlus1, MaybeMap
) where
import Type.Booleans
data Nothing
data Just (x :: *)
type family IsJust (x :: *) :: *
type instance IsJust Nothing = False
type instance IsJust (Just x) = True
type family MaybePlus1 (x :: *) (y :: *) :: *
type instance MaybePlus1 Nothing y = y
type instance MaybePlus1 (Just x) Nothing = Just x
type family MaybeMap (f :: * -> *) (x :: *) :: *
type instance MaybeMap f (Just x) = Just (f x)
type instance MaybeMap f Nothing = Nothing