singleraeh-0.4.0: raehik's singletons
Safe HaskellSafe-Inferred
LanguageGHC2021

Singleraeh.Maybe

Synopsis

Documentation

data SMaybe sa ma where Source #

Singleton Maybe.

Constructors

SJust :: sa a -> SMaybe sa (Just a) 
SNothing :: SMaybe sa Nothing 

Instances

Instances details
Demotable sa => Demotable (SMaybe sa :: Maybe a -> Type) Source # 
Instance details

Defined in Singleraeh.Maybe

Associated Types

type Demote (SMaybe sa) Source #

Methods

demote :: forall (k1 :: k). SMaybe sa k1 -> Demote (SMaybe sa) Source #

type Demote (SMaybe sa :: Maybe a -> Type) Source # 
Instance details

Defined in Singleraeh.Maybe

type Demote (SMaybe sa :: Maybe a -> Type) = Maybe (Demote sa)

demoteSMaybe :: forall da sa ma. (forall a. sa a -> da) -> SMaybe sa ma -> Maybe da Source #

class SingMaybe (ca :: ak -> Constraint) (sa :: ak -> Type) (ma :: Maybe ak) where Source #

Methods

singMaybe' :: (forall a. ca a => sa a) -> SMaybe sa ma Source #

Instances

Instances details
SingMaybe (ca :: ak -> Constraint) (sa :: ak -> Type) ('Nothing :: Maybe ak) Source # 
Instance details

Defined in Singleraeh.Maybe

Methods

singMaybe' :: (forall (a :: ak0). ca a => sa a) -> SMaybe sa 'Nothing Source #

ca a2 => SingMaybe (ca :: a1 -> Constraint) (sa :: a1 -> Type) ('Just a2 :: Maybe a1) Source # 
Instance details

Defined in Singleraeh.Maybe

Methods

singMaybe' :: (forall (a :: ak). ca a => sa a) -> SMaybe sa ('Just a2) Source #

singMaybe :: forall ca sa ma. SingMaybe ca sa ma => (forall a. ca a => sa a) -> SMaybe sa ma Source #