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 ... #

Concatenation of type-level symbols.

@since base-4.10.0.0

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

An infix synonym for `AppendSymbol`.

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) #