| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Data.Type.Witness.General.Representative
Synopsis
- isWitnessRepresentative :: forall {k} rep (a :: k). Dict (Is rep a) -> rep a
- type Subrepresentative (p :: k -> Type) (q :: k -> Type) = forall (a :: k). p a -> Dict (Is q a)
- withSubrepresentative :: forall {k} p (q :: k -> Type) (a :: k) r. Subrepresentative p q -> p a -> (Is q a => r) -> r
- class Representative (rep :: k -> Type) where
- getRepWitness :: Subrepresentative rep rep
- withRepresentative :: forall {k} rep (a :: k) r. Representative rep => rep a -> (Is rep a => r) -> r
- class Representative rep => Is (rep :: k -> Type) (a :: k) where
- representative :: rep a
- getRepresentative :: Is rep a => a -> rep a
- rerepresentative :: forall {k} rep (a :: k) p. Is rep a => p a -> rep a
- fromRepWitness :: forall {k} rep (a :: k). Dict (Is rep a) -> rep a
- mkSomeOf :: forall (rep :: Type -> Type) a. Is rep a => a -> SomeOf rep
- mkSomeFor :: forall {k} (rep :: k -> Type) (a :: k) f. Is rep a => f a -> SomeFor f rep
- typeValue :: forall k (rep :: k -> Type) (a :: k). (Is rep a, WitnessValue rep) => WitnessValueType rep
- matchIs :: forall {k} (w :: k -> Type) (a :: k) (b :: k). (TestEquality w, Is w a, Is w b) => Maybe (a :~: b)
Documentation
isWitnessRepresentative :: forall {k} rep (a :: k). Dict (Is rep a) -> rep a Source #
type Subrepresentative (p :: k -> Type) (q :: k -> Type) = forall (a :: k). p a -> Dict (Is q a) Source #
withSubrepresentative :: forall {k} p (q :: k -> Type) (a :: k) r. Subrepresentative p q -> p a -> (Is q a => r) -> r Source #
class Representative (rep :: k -> Type) where Source #
Instances
withRepresentative :: forall {k} rep (a :: k) r. Representative rep => rep a -> (Is rep a => r) -> r Source #
class Representative rep => Is (rep :: k -> Type) (a :: k) where Source #
If two representatives have the same type, then they have the same value.
Instances
getRepresentative :: Is rep a => a -> rep a Source #
rerepresentative :: forall {k} rep (a :: k) p. Is rep a => p a -> rep a Source #
fromRepWitness :: forall {k} rep (a :: k). Dict (Is rep a) -> rep a Source #
typeValue :: forall k (rep :: k -> Type) (a :: k). (Is rep a, WitnessValue rep) => WitnessValueType rep Source #