eliminators-0.9.5: Dependently typed elimination functions using singletons
Copyright(C) 2022 Ryan Scott
LicenseBSD-style (see the file LICENSE)
MaintainerRyan Scott
StabilityExperimental
PortabilityGHC
Safe HaskellTrustworthy
LanguageGHC2021

Data.Eliminator.TypeLits

Description

Crude imitations of eliminator functions for Nat and Symbol.

Synopsis

Documentation

elimNat :: forall (p :: Nat ~> Type) (n :: Nat). Sing n -> Apply p 0 -> (forall (k :: Nat). Sing k -> Apply p k -> Apply p (k + 1)) -> Apply p n Source #

Although Nat is not actually an inductive data type in GHC, we can (crudely) pretend that it is using this eliminator.

elimSymbol :: forall (p :: Symbol ~> Type) (s :: Symbol). Sing s -> Apply p "" -> (forall (c :: Char) (ss :: Symbol). Sing c -> Sing ss -> Apply p ss -> Apply p (ConsSymbol c ss)) -> Apply p s Source #

Although Nat is not actually an inductive data type in GHC, we can (crudely) pretend that it is using this eliminator.