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

Singleraeh.List

Synopsis

Documentation

data SList sa as where Source #

Singleton list.

Constructors

SCons :: sa a -> SList sa as -> SList sa (a : as) 
SNil :: SList sa '[] 

Instances

Instances details
Demotable sa => Demotable (SList sa :: [a] -> Type) Source # 
Instance details

Defined in Singleraeh.List

Associated Types

type Demote (SList sa) Source #

Methods

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

type Demote (SList sa :: [a] -> Type) Source # 
Instance details

Defined in Singleraeh.List

type Demote (SList sa :: [a] -> Type) = [Demote sa]

demoteSList :: forall da sa as. (forall a. sa a -> da) -> SList sa as -> [da] Source #

type Reverse as = Reverse' '[] as Source #

Reverse a type level list.

type family Reverse' (acc :: [k]) (as :: [k]) :: [k] where ... Source #

Equations

Reverse' acc (a : as) = Reverse' (a : acc) as 
Reverse' acc '[] = acc 

sReverse :: SList sa as -> SList sa (Reverse as) Source #

sReverse' :: SList sa acc -> SList sa as -> SList sa (Reverse' acc as) Source #