| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Proof.Equational
- data (k :~: (a :: k)) (b :: k) :: forall k. k -> k -> * where
- type (:=:) = (:~:)
- sym :: (:~:) k a b -> (:~:) k b a
- trans :: (:~:) k a b -> (:~:) k b c -> (:~:) k a c
- class Preorder eq => Equality (eq :: k -> k -> *) where
- class Preorder (eq :: k -> k -> *) where
- reflexivity' :: (SingI x, Preorder r) => r x x
- type (:\/:) a b = Either a b
- type (:/\:) a b = (a, b)
- (=<=) :: Preorder r => r x y -> Reason r y z -> r x z
- (=>=) :: Preorder r => r y z -> Reason r x y -> r x z
- (=~=) :: r x y -> Sing y -> r x y
- data Leibniz a b = Leibniz {
- apply :: forall f. f a -> f b
- data Reason eq x y where
- because :: Sing y -> eq x y -> Reason eq x y
- by :: Sing y -> eq x y -> Reason eq x y
- (===) :: Equality eq => eq x y -> Reason eq y z -> eq x z
- start :: Preorder eq => Sing a -> eq a a
- byDefinition :: (SingI a, Preorder eq) => eq a a
- admitted :: Reason eq x y
- data Proxy k (t :: k) :: forall k. k -> * = Proxy
- cong :: forall f a b. Proxy f -> (a :=: b) -> f a :=: f b
- cong' :: (Sing m -> Sing (f m)) -> (a :=: b) -> f a :=: f b
- class Proposition (f :: k -> *) where
- type OriginalProp (f :: k -> *) (n :: k) :: *
- data HVec (xs :: [*]) where
- class FromBool (c :: *) where
- applyNAry :: forall ts c. KnownTypeList ts => (HVec ts -> c) -> ts :~> c
- applyNAry' :: KnownTypeList ts => proxy ts -> proxy' c -> (HVec ts -> c) -> ts :~> c
- fromBool' :: forall proxy c. (KnownTypeList (Args c), FromBool c, Predicate c ~ True) => proxy c -> Args c :~> c
- fromRefl :: (Preorder eq, SingI b) => (a :=: b) -> eq a b
- fromLeibniz :: (Preorder eq, SingI a) => Leibniz a b -> eq a b
- reflToLeibniz :: (a :=: b) -> Leibniz a b
- leibnizToRefl :: Leibniz a b -> a :=: b
- coerce :: (a :=: b) -> f a -> f b
- coerce' :: (a :=: b) -> a -> b
- withRefl :: forall a b r. (a :~: b) -> (a ~ b => r) -> r
- module Data.Singletons
- module Data.Proxy
Documentation
data (k :~: (a :: k)) (b :: k) :: forall k. k -> k -> * where infix 4 #
Propositional equality. If a :~: b is inhabited by some terminating
value, then the type a is the same as the type b. To use this equality
in practice, pattern-match on the a :~: b to get out the Refl constructor;
in the body of the pattern-match, the compiler knows that a ~ b.
Since: 4.7.0.0
Instances
| Equality k ((:=:) k) Source # | |
| Preorder k ((:=:) k) Source # | |
| TestEquality k ((:~:) k a) | Since: 4.7.0.0 |
| (~) k a b => Bounded ((:~:) k a b) | Since: 4.7.0.0 |
| (~) k a b => Enum ((:~:) k a b) | Since: 4.7.0.0 |
| Eq ((:~:) k a b) | |
| ((~) * a b, Data a) => Data ((:~:) * a b) | Since: 4.7.0.0 |
| Ord ((:~:) k a b) | |
| (~) k a b => Read ((:~:) k a b) | Since: 4.7.0.0 |
| Show ((:~:) k a b) | |
reflexivity' :: (SingI x, Preorder r) => r x x Source #
byDefinition :: (SingI a, Preorder eq) => eq a a Source #
data Proxy k (t :: k) :: forall k. k -> * #
A concrete, poly-kinded proxy type
Constructors
| Proxy |
Instances
| Generic1 k (Proxy k) | |
| Monad (Proxy *) | Since: 4.7.0.0 |
| Functor (Proxy *) | Since: 4.7.0.0 |
| Applicative (Proxy *) | Since: 4.7.0.0 |
| Foldable (Proxy *) | Since: 4.7.0.0 |
| Traversable (Proxy *) | Since: 4.7.0.0 |
| Alternative (Proxy *) | Since: 4.9.0.0 |
| MonadPlus (Proxy *) | Since: 4.9.0.0 |
| Bounded (Proxy k t) | |
| Enum (Proxy k s) | Since: 4.7.0.0 |
| Eq (Proxy k s) | Since: 4.7.0.0 |
| Data t => Data (Proxy * t) | Since: 4.7.0.0 |
| Ord (Proxy k s) | Since: 4.7.0.0 |
| Read (Proxy k s) | Since: 4.7.0.0 |
| Show (Proxy k s) | Since: 4.7.0.0 |
| Ix (Proxy k s) | Since: 4.7.0.0 |
| Generic (Proxy k t) | |
| Semigroup (Proxy k s) | Since: 4.9.0.0 |
| Monoid (Proxy k s) | Since: 4.7.0.0 |
| type Rep1 k (Proxy k) | |
| type Rep (Proxy k t) | |
class Proposition (f :: k -> *) where Source #
Associated Types
type OriginalProp (f :: k -> *) (n :: k) :: * Source #
applyNAry' :: KnownTypeList ts => proxy ts -> proxy' c -> (HVec ts -> c) -> ts :~> c Source #
fromBool' :: forall proxy c. (KnownTypeList (Args c), FromBool c, Predicate c ~ True) => proxy c -> Args c :~> c Source #
Conversion between equalities
reflToLeibniz :: (a :=: b) -> Leibniz a b Source #
leibnizToRefl :: Leibniz a b -> a :=: b Source #
Coercion
coerce :: (a :=: b) -> f a -> f b Source #
Type coercion. coerce is using unsafeCoerce a.
So, please, please do not provide the undefined as the proof.
Using this function instead of pattern-matching on equality proof,
you can reduce the overhead introduced by run-time proof.
withRefl :: forall a b r. (a :~: b) -> (a ~ b => r) -> r Source #
Solves equality constraint without explicit coercion.
It has the same effect as ,
but some hacks is done to reduce runtime overhead.gcastWith
Re-exported modules
module Data.Singletons
module Data.Proxy