{-# LANGUAGE EmptyDataDecls, TypeFamilies #-} module Types.Data.Maybe ( Maybe , Nothing , Just , IsNothing , IsJust , FromJust , FromMaybe ) where import Prelude () import Types.Data.Bool data Nothing data Just a class Maybe a instance Maybe Nothing instance Maybe (Just a) type family IsNothing m type instance IsNothing Nothing = True type instance IsNothing (Just a) = False type family IsJust m type instance IsJust Nothing = False type instance IsJust (Just a) = True type family FromJust m type instance FromJust (Just a) = a type family FromMaybe a m type instance FromMaybe a Nothing = a type instance FromMaybe a (Just a') = a'