constraints-0.14.2: Constraint manipulation

Safe Haskell | None
Language | Haskell2010

Data.Constraint.Symbol

Description

Utilities for working with `KnownSymbol` constraints.

Synopsis

- type family AppendSymbol (a :: Symbol) (b :: Symbol) :: Symbol where ...
- type (++) (m :: Symbol) (n :: Symbol) = AppendSymbol m n
- type family Take :: Nat -> Symbol -> Symbol where ...
- type family Drop :: Nat -> Symbol -> Symbol where ...
- type family Length :: Symbol -> Nat where ...
- appendSymbol :: forall (a :: Symbol) (b :: Symbol). (KnownSymbol a, KnownSymbol b) :- KnownSymbol (AppendSymbol a b)
- appendUnit1 :: forall (a :: Symbol). Dict (AppendSymbol "" a ~ a)
- appendUnit2 :: forall (a :: Symbol). Dict (AppendSymbol a "" ~ a)
- appendAssociates :: forall (a :: Symbol) (b :: Symbol) (c :: Symbol). Dict (AppendSymbol (AppendSymbol a b) c ~ AppendSymbol a (AppendSymbol b c))
- takeSymbol :: forall (n :: Nat) (a :: Symbol). (KnownNat n, KnownSymbol a) :- KnownSymbol (Take n a)
- dropSymbol :: forall (n :: Nat) (a :: Symbol). (KnownNat n, KnownSymbol a) :- KnownSymbol (Drop n a)
- takeAppendDrop :: forall (n :: Nat) (a :: Symbol). Dict (AppendSymbol (Take n a) (Drop n a) ~ a)
- lengthSymbol :: forall (a :: Symbol). KnownSymbol a :- KnownNat (Length a)
- takeLength :: forall (n :: Nat) (a :: Symbol). (Length a <= n) :- (Take n a ~ a)
- take0 :: forall (a :: Symbol). Dict (Take 0 a ~ "")
- takeEmpty :: forall (n :: Nat). Dict (Take n "" ~ "")
- dropLength :: forall (n :: Nat) (a :: Symbol). (Length a <= n) :- (Drop n a ~ "")
- drop0 :: forall (a :: Symbol). Dict (Drop 0 a ~ a)
- dropEmpty :: forall (n :: Nat). Dict (Drop n "" ~ "")
- lengthTake :: forall (n :: Nat) (a :: Symbol). Dict (Length (Take n a) <= n)
- lengthDrop :: forall (n :: Nat) (a :: Symbol). Dict (Length a <= (Length (Drop n a) + n))
- dropDrop :: forall (n :: Nat) (m :: Nat) (a :: Symbol). Dict (Drop n (Drop m a) ~ Drop (n + m) a)
- takeTake :: forall (n :: Nat) (m :: Nat) (a :: Symbol). Dict (Take n (Take m a) ~ Take (Min n m) a)

# Documentation

type family AppendSymbol (a :: Symbol) (b :: Symbol) :: Symbol where ... Source #

Concatenation of type-level symbols.

Since: base-4.10.0.0

type (++) (m :: Symbol) (n :: Symbol) = AppendSymbol m n infixr 5 Source #

An infix synonym for `AppendSymbol`.

type family Take :: Nat -> Symbol -> Symbol where ... Source #

type family Drop :: Nat -> Symbol -> Symbol where ... Source #

type family Length :: Symbol -> Nat where ... Source #

appendSymbol :: forall (a :: Symbol) (b :: Symbol). (KnownSymbol a, KnownSymbol b) :- KnownSymbol (AppendSymbol a b) Source #

appendUnit1 :: forall (a :: Symbol). Dict (AppendSymbol "" a ~ a) Source #

appendUnit2 :: forall (a :: Symbol). Dict (AppendSymbol a "" ~ a) Source #

appendAssociates :: forall (a :: Symbol) (b :: Symbol) (c :: Symbol). Dict (AppendSymbol (AppendSymbol a b) c ~ AppendSymbol a (AppendSymbol b c)) Source #

takeSymbol :: forall (n :: Nat) (a :: Symbol). (KnownNat n, KnownSymbol a) :- KnownSymbol (Take n a) Source #

dropSymbol :: forall (n :: Nat) (a :: Symbol). (KnownNat n, KnownSymbol a) :- KnownSymbol (Drop n a) Source #

takeAppendDrop :: forall (n :: Nat) (a :: Symbol). Dict (AppendSymbol (Take n a) (Drop n a) ~ a) Source #

lengthSymbol :: forall (a :: Symbol). KnownSymbol a :- KnownNat (Length a) Source #

takeLength :: forall (n :: Nat) (a :: Symbol). (Length a <= n) :- (Take n a ~ a) Source #

take0 :: forall (a :: Symbol). Dict (Take 0 a ~ "") Source #

takeEmpty :: forall (n :: Nat). Dict (Take n "" ~ "") Source #

dropLength :: forall (n :: Nat) (a :: Symbol). (Length a <= n) :- (Drop n a ~ "") Source #

drop0 :: forall (a :: Symbol). Dict (Drop 0 a ~ a) Source #

dropEmpty :: forall (n :: Nat). Dict (Drop n "" ~ "") Source #

lengthTake :: forall (n :: Nat) (a :: Symbol). Dict (Length (Take n a) <= n) Source #

lengthDrop :: forall (n :: Nat) (a :: Symbol). Dict (Length a <= (Length (Drop n a) + n)) Source #

dropDrop :: forall (n :: Nat) (m :: Nat) (a :: Symbol). Dict (Drop n (Drop m a) ~ Drop (n + m) a) Source #

takeTake :: forall (n :: Nat) (m :: Nat) (a :: Symbol). Dict (Take n (Take m a) ~ Take (Min n m) a) Source #