termonad-1.0.1.0: Terminal emulator configurable in Haskell

Copyright(c) Dennis Gosnell 2018
LicenseBSD3
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Termonad.Config.Vec

Description

This is a small library of dependent types. It provides indexed types like Fin, Vec, and Matrix.

This is mainly used in Termonad for Termonad.Config.Colour to represent length-indexed colour lists.

This module implements a subset of the functionality from the abandoned type-combinators library. Ideally this module would be split out to a separate package. If you're interested in working on something like this, please see this issue on Github.

Synopsis

Documentation

data Peano Source #

Constructors

Z 
S Peano 
Instances
Eq Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(==) :: Peano -> Peano -> Bool #

(/=) :: Peano -> Peano -> Bool #

Num Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Ord Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

compare :: Peano -> Peano -> Ordering #

(<) :: Peano -> Peano -> Bool #

(<=) :: Peano -> Peano -> Bool #

(>) :: Peano -> Peano -> Bool #

(>=) :: Peano -> Peano -> Bool #

max :: Peano -> Peano -> Peano #

min :: Peano -> Peano -> Peano #

Show Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Peano -> ShowS #

show :: Peano -> String #

showList :: [Peano] -> ShowS #

PShow Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type ShowsPrec arg arg1 arg2 :: Symbol #

type Show_ arg :: Symbol #

type ShowList arg arg1 :: Symbol #

SShow Peano => SShow Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sShowsPrec :: Sing t1 -> Sing t2 -> Sing t3 -> Sing (Apply (Apply (Apply ShowsPrecSym0 t1) t2) t3) #

sShow_ :: Sing t -> Sing (Apply Show_Sym0 t) #

sShowList :: Sing t1 -> Sing t2 -> Sing (Apply (Apply ShowListSym0 t1) t2) #

PNum Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type arg + arg1 :: a #

type arg - arg1 :: a #

type arg * arg1 :: a #

type Negate arg :: a #

type Abs arg :: a #

type Signum arg :: a #

type FromInteger arg :: a #

SNum Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(%+) :: Sing t1 -> Sing t2 -> Sing (Apply (Apply (+@#@$) t1) t2) #

(%-) :: Sing t1 -> Sing t2 -> Sing (Apply (Apply (-@#@$) t1) t2) #

(%*) :: Sing t1 -> Sing t2 -> Sing (Apply (Apply (*@#@$) t1) t2) #

sNegate :: Sing t -> Sing (Apply NegateSym0 t) #

sAbs :: Sing t -> Sing (Apply AbsSym0 t) #

sSignum :: Sing t -> Sing (Apply SignumSym0 t) #

sFromInteger :: Sing t -> Sing (Apply FromIntegerSym0 t) #

ShowSing Peano => ShowSing Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsSingPrec :: Int -> Sing a -> ShowS #

POrd Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type Compare arg arg1 :: Ordering #

type arg < arg1 :: Bool #

type arg <= arg1 :: Bool #

type arg > arg1 :: Bool #

type arg >= arg1 :: Bool #

type Max arg arg1 :: a #

type Min arg arg1 :: a #

SOrd Peano => SOrd Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sCompare :: Sing t1 -> Sing t2 -> Sing (Apply (Apply CompareSym0 t1) t2) #

(%<) :: Sing t1 -> Sing t2 -> Sing (Apply (Apply (<@#@$) t1) t2) #

(%<=) :: Sing t1 -> Sing t2 -> Sing (Apply (Apply (<=@#@$) t1) t2) #

(%>) :: Sing t1 -> Sing t2 -> Sing (Apply (Apply (>@#@$) t1) t2) #

(%>=) :: Sing t1 -> Sing t2 -> Sing (Apply (Apply (>=@#@$) t1) t2) #

sMax :: Sing t1 -> Sing t2 -> Sing (Apply (Apply MaxSym0 t1) t2) #

sMin :: Sing t1 -> Sing t2 -> Sing (Apply (Apply MinSym0 t1) t2) #

SEq Peano => SEq Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(%==) :: Sing a -> Sing b -> Sing (a == b) #

(%/=) :: Sing a -> Sing b -> Sing (a /= b) #

PEq Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type x == y :: Bool #

type x /= y :: Bool #

SDecide Peano => SDecide Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(%~) :: Sing a -> Sing b -> Decision (a :~: b) #

SingKind Peano Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type Demote Peano = (r :: *) #

SingI Z Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sing :: Sing Z #

SingI n => SingI (S n :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sing :: Sing (S n) #

Num a => Num (Matrix ([] :: [Peano]) a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(+) :: Matrix [] a -> Matrix [] a -> Matrix [] a #

(-) :: Matrix [] a -> Matrix [] a -> Matrix [] a #

(*) :: Matrix [] a -> Matrix [] a -> Matrix [] a #

negate :: Matrix [] a -> Matrix [] a #

abs :: Matrix [] a -> Matrix [] a #

signum :: Matrix [] a -> Matrix [] a #

fromInteger :: Integer -> Matrix [] a #

ShowSing Peano => Show (Sing z) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Sing z -> ShowS #

show :: Sing z -> String #

showList :: [Sing z] -> ShowS #

SuppressUnusedWarnings ShowsPrec_6989586621679401357Sym2 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings ShowsPrec_6989586621679401357Sym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings Compare_6989586621679400935Sym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings TFHelper_6989586621679401470Sym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings TFHelper_6989586621679401444Sym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings TFHelper_6989586621679401418Sym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings MultPeanoSym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings AddPeanoSym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings SubtractPeanoSym1 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings ShowsPrec_6989586621679401357Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings FromInteger_6989586621679401522Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings Compare_6989586621679400935Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings TFHelper_6989586621679401470Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings TFHelper_6989586621679401444Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings TFHelper_6989586621679401418Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings MultPeanoSym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings AddPeanoSym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings SubtractPeanoSym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings Signum_6989586621679401497Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings Abs_6989586621679401487Sym0 Source # 
Instance details

Defined in Termonad.Config.Vec

SuppressUnusedWarnings SSym0 Source # 
Instance details

Defined in Termonad.Config.Vec

data Sing (z :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

data Sing (z :: Peano) where
type Demote Peano Source # 
Instance details

Defined in Termonad.Config.Vec

type Show_ (arg :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Show_ (arg :: Peano) = Apply (Show__6989586621679970516Sym0 :: TyFun Peano Symbol -> *) arg
type FromInteger a Source # 
Instance details

Defined in Termonad.Config.Vec

type Signum (a :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Abs (a :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Negate (arg :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Negate (arg :: Peano) = Apply (Negate_6989586621679649502Sym0 :: TyFun Peano Peano -> *) arg
type ShowList (arg :: [Peano]) arg1 Source # 
Instance details

Defined in Termonad.Config.Vec

type ShowList (arg :: [Peano]) arg1 = Apply (Apply (ShowList_6989586621679970538Sym0 :: TyFun [Peano] (TyFun Symbol Symbol -> Type) -> *) arg) arg1
type (a1 :: Peano) * (a2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (a1 :: Peano) * (a2 :: Peano) = Apply (Apply TFHelper_6989586621679401470Sym0 a1) a2
type (a1 :: Peano) - (a2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (a1 :: Peano) - (a2 :: Peano) = Apply (Apply TFHelper_6989586621679401444Sym0 a1) a2
type (a1 :: Peano) + (a2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (a1 :: Peano) + (a2 :: Peano) = Apply (Apply TFHelper_6989586621679401418Sym0 a1) a2
type Min (arg :: Peano) (arg1 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Min (arg :: Peano) (arg1 :: Peano) = Apply (Apply (Min_6989586621679572724Sym0 :: TyFun Peano (TyFun Peano Peano -> Type) -> *) arg) arg1
type Max (arg :: Peano) (arg1 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Max (arg :: Peano) (arg1 :: Peano) = Apply (Apply (Max_6989586621679572691Sym0 :: TyFun Peano (TyFun Peano Peano -> Type) -> *) arg) arg1
type (arg :: Peano) >= (arg1 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (arg :: Peano) >= (arg1 :: Peano) = Apply (Apply (TFHelper_6989586621679572658Sym0 :: TyFun Peano (TyFun Peano Bool -> Type) -> *) arg) arg1
type (arg :: Peano) > (arg1 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (arg :: Peano) > (arg1 :: Peano) = Apply (Apply (TFHelper_6989586621679572625Sym0 :: TyFun Peano (TyFun Peano Bool -> Type) -> *) arg) arg1
type (arg :: Peano) <= (arg1 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (arg :: Peano) <= (arg1 :: Peano) = Apply (Apply (TFHelper_6989586621679572592Sym0 :: TyFun Peano (TyFun Peano Bool -> Type) -> *) arg) arg1
type (arg :: Peano) < (arg1 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (arg :: Peano) < (arg1 :: Peano) = Apply (Apply (TFHelper_6989586621679572559Sym0 :: TyFun Peano (TyFun Peano Bool -> Type) -> *) arg) arg1
type Compare (a1 :: Peano) (a2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (x :: Peano) /= (y :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (x :: Peano) /= (y :: Peano) = Not (x == y)
type (a :: Peano) == (b :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type (a :: Peano) == (b :: Peano) = Equals_6989586621679401527 a b
type ShowsPrec a1 (a2 :: Peano) a3 Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply FromInteger_6989586621679401522Sym0 (l :: Nat) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply Signum_6989586621679401497Sym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply Abs_6989586621679401487Sym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply SSym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply SSym0 (l :: Peano) = S l
type Apply (Compare_6989586621679400935Sym1 l1 :: TyFun Peano Ordering -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (TFHelper_6989586621679401470Sym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (TFHelper_6989586621679401444Sym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (TFHelper_6989586621679401418Sym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (MultPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (MultPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) = MultPeano l1 l2
type Apply (AddPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (AddPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) = AddPeano l1 l2
type Apply (SubtractPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (SubtractPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) = SubtractPeano l1 l2
type Apply ShowsPrec_6989586621679401357Sym0 (l :: Nat) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply Compare_6989586621679400935Sym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply TFHelper_6989586621679401470Sym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply TFHelper_6989586621679401444Sym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply TFHelper_6989586621679401418Sym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply MultPeanoSym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply AddPeanoSym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply SubtractPeanoSym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (ShowsPrec_6989586621679401357Sym1 l1 :: TyFun Peano (TyFun Symbol Symbol -> Type) -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply MatrixTFSym0 (l :: [Peano]) Source # 
Instance details

Defined in Termonad.Config.Vec

type ZSym0 = Z Source #

type SSym1 (t :: Peano) = S t Source #

data SSym0 (l :: TyFun Peano Peano) Source #

Constructors

SameKind (Apply SSym0 arg) (SSym1 arg) => SSym0KindInference 
Instances
SuppressUnusedWarnings SSym0 Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply SSym0 (l :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply SSym0 (l :: Peano) = S l

type family N0 :: Peano where ... Source #

Equations

N0 = ZSym0 

type N0Sym0 = N0 Source #

type family N1 :: Peano where ... Source #

Equations

N1 = Apply SSym0 N0Sym0 

type N1Sym0 = N1 Source #

type family N2 :: Peano where ... Source #

Equations

N2 = Apply SSym0 N1Sym0 

type N2Sym0 = N2 Source #

type family N3 :: Peano where ... Source #

Equations

N3 = Apply SSym0 N2Sym0 

type N3Sym0 = N3 Source #

type family N4 :: Peano where ... Source #

Equations

N4 = Apply SSym0 N3Sym0 

type N4Sym0 = N4 Source #

type family N5 :: Peano where ... Source #

Equations

N5 = Apply SSym0 N4Sym0 

type N5Sym0 = N5 Source #

type family N6 :: Peano where ... Source #

Equations

N6 = Apply SSym0 N5Sym0 

type N6Sym0 = N6 Source #

type family N7 :: Peano where ... Source #

Equations

N7 = Apply SSym0 N6Sym0 

type N7Sym0 = N7 Source #

type family N8 :: Peano where ... Source #

Equations

N8 = Apply SSym0 N7Sym0 

type N8Sym0 = N8 Source #

type family N9 :: Peano where ... Source #

Equations

N9 = Apply SSym0 N8Sym0 

type N9Sym0 = N9 Source #

type family N10 :: Peano where ... Source #

Equations

N10 = Apply SSym0 N9Sym0 

type family SubtractPeano (a :: Peano) (a :: Peano) :: Peano where ... Source #

data SubtractPeanoSym1 (l :: Peano) (l :: TyFun Peano Peano) Source #

Instances
SuppressUnusedWarnings SubtractPeanoSym1 Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (SubtractPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (SubtractPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) = SubtractPeano l1 l2

type family AddPeano (a :: Peano) (a :: Peano) :: Peano where ... Source #

Equations

AddPeano Z a = a 
AddPeano (S a) b = Apply SSym0 (Apply (Apply AddPeanoSym0 a) b) 

data AddPeanoSym1 (l :: Peano) (l :: TyFun Peano Peano) Source #

Instances
SuppressUnusedWarnings AddPeanoSym1 Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (AddPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (AddPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) = AddPeano l1 l2

type AddPeanoSym2 (t :: Peano) (t :: Peano) = AddPeano t t Source #

type family MultPeano (a :: Peano) (a :: Peano) :: Peano where ... Source #

data MultPeanoSym1 (l :: Peano) (l :: TyFun Peano Peano) Source #

Instances
SuppressUnusedWarnings MultPeanoSym1 Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (MultPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (MultPeanoSym1 l1 :: TyFun Peano Peano -> *) (l2 :: Peano) = MultPeano l1 l2

type MultPeanoSym2 (t :: Peano) (t :: Peano) = MultPeano t t Source #

type family N24 :: Peano where ... Source #

type family Compare_6989586621679400935 (a :: Peano) (a :: Peano) :: Ordering where ... Source #

Equations

Compare_6989586621679400935 Z Z = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[] 
Compare_6989586621679400935 (S a_6989586621679399769) (S b_6989586621679399771) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_6989586621679399769) b_6989586621679399771)) '[]) 
Compare_6989586621679400935 Z (S _) = LTSym0 
Compare_6989586621679400935 (S _) Z = GTSym0 

type family ShowsPrec_6989586621679401357 (a :: Nat) (a :: Peano) (a :: Symbol) :: Symbol where ... Source #

Equations

ShowsPrec_6989586621679401357 _ Z a_6989586621679401346 = Apply (Apply ShowStringSym0 (FromString "Z")) a_6989586621679401346 
ShowsPrec_6989586621679401357 p_6989586621679399773 (S arg_6989586621679399775) a_6989586621679401348 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_6989586621679399773) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 (FromString "S "))) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_6989586621679399775))) a_6989586621679401348 

type family TFHelper_6989586621679401418 (a :: Peano) (a :: Peano) :: Peano where ... Source #

Equations

TFHelper_6989586621679401418 a_6989586621679401401 a_6989586621679401403 = Apply (Apply AddPeanoSym0 a_6989586621679401401) a_6989586621679401403 

type family TFHelper_6989586621679401444 (a :: Peano) (a :: Peano) :: Peano where ... Source #

Equations

TFHelper_6989586621679401444 a_6989586621679401427 a_6989586621679401429 = Apply (Apply SubtractPeanoSym0 a_6989586621679401427) a_6989586621679401429 

type family TFHelper_6989586621679401470 (a :: Peano) (a :: Peano) :: Peano where ... Source #

Equations

TFHelper_6989586621679401470 a_6989586621679401453 a_6989586621679401455 = Apply (Apply MultPeanoSym0 a_6989586621679401453) a_6989586621679401455 

type family Abs_6989586621679401487 (a :: Peano) :: Peano where ... Source #

Equations

Abs_6989586621679401487 a_6989586621679401479 = Apply IdSym0 a_6989586621679401479 

type SPeano = (Sing :: Peano -> Type) Source #

sMultPeano :: forall (t :: Peano) (t :: Peano). Sing t -> Sing t -> Sing (Apply (Apply MultPeanoSym0 t) t :: Peano) Source #

sAddPeano :: forall (t :: Peano) (t :: Peano). Sing t -> Sing t -> Sing (Apply (Apply AddPeanoSym0 t) t :: Peano) Source #

sSubtractPeano :: forall (t :: Peano) (t :: Peano). Sing t -> Sing t -> Sing (Apply (Apply SubtractPeanoSym0 t) t :: Peano) Source #

data Fin :: Peano -> Type where Source #

Constructors

FZ :: forall (n :: Peano). Fin (S n) 
FS :: forall (n :: Peano). !(Fin n) -> Fin (S n) 
Instances
Eq (Fin n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(==) :: Fin n -> Fin n -> Bool #

(/=) :: Fin n -> Fin n -> Bool #

Ord (Fin n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

compare :: Fin n -> Fin n -> Ordering #

(<) :: Fin n -> Fin n -> Bool #

(<=) :: Fin n -> Fin n -> Bool #

(>) :: Fin n -> Fin n -> Bool #

(>=) :: Fin n -> Fin n -> Bool #

max :: Fin n -> Fin n -> Fin n #

min :: Fin n -> Fin n -> Fin n #

Show (Fin n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Fin n -> ShowS #

show :: Fin n -> String #

showList :: [Fin n] -> ShowS #

SingKind (Fin n) Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type Demote (Fin n) = (r :: *) #

Methods

fromSing :: Sing a -> Demote (Fin n) #

toSing :: Demote (Fin n) -> SomeSing (Fin n) #

SingI (FZ :: Fin (S n)) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sing :: Sing FZ #

SingI n2 => SingI (FS n2 :: Fin (S n1)) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sing :: Sing (FS n2) #

Show (Sing n2) => Show (Sing (FS n2)) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Sing (FS n2) -> ShowS #

show :: Sing (FS n2) -> String #

showList :: [Sing (FS n2)] -> ShowS #

Show (Sing (FZ :: Fin (S n))) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Sing FZ -> ShowS #

show :: Sing FZ -> String #

showList :: [Sing FZ] -> ShowS #

data Sing (z :: Fin n) Source # 
Instance details

Defined in Termonad.Config.Vec

data Sing (z :: Fin n) where
type Demote (Fin n) Source # 
Instance details

Defined in Termonad.Config.Vec

type Demote (Fin n) = Fin n

data IFin :: Peano -> Peano -> Type where Source #

Constructors

IFZ :: forall (n :: Peano). IFin (S n) Z 
IFS :: forall (n :: Peano) (m :: Peano). !(IFin n m) -> IFin (S n) (S m) 
Instances
Eq (IFin x y) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(==) :: IFin x y -> IFin x y -> Bool #

(/=) :: IFin x y -> IFin x y -> Bool #

Ord (IFin x y) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

compare :: IFin x y -> IFin x y -> Ordering #

(<) :: IFin x y -> IFin x y -> Bool #

(<=) :: IFin x y -> IFin x y -> Bool #

(>) :: IFin x y -> IFin x y -> Bool #

(>=) :: IFin x y -> IFin x y -> Bool #

max :: IFin x y -> IFin x y -> IFin x y #

min :: IFin x y -> IFin x y -> IFin x y #

Show (Sing n2) => Show (Sing (IFS n2)) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Sing (IFS n2) -> ShowS #

show :: Sing (IFS n2) -> String #

showList :: [Sing (IFS n2)] -> ShowS #

Show (Sing (IFZ :: IFin (S n) Z)) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Sing IFZ -> ShowS #

show :: Sing IFZ -> String #

showList :: [Sing IFZ] -> ShowS #

Show (IFin x y) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> IFin x y -> ShowS #

show :: IFin x y -> String #

showList :: [IFin x y] -> ShowS #

SingKind (IFin n m) Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type Demote (IFin n m) = (r :: *) #

Methods

fromSing :: Sing a -> Demote (IFin n m) #

toSing :: Demote (IFin n m) -> SomeSing (IFin n m) #

SingI (IFZ :: IFin (S n) Z) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sing :: Sing IFZ #

SingI n2 => SingI (IFS n2 :: IFin (S n1) (S m)) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

sing :: Sing (IFS n2) #

data Sing (z :: IFin n m) Source # 
Instance details

Defined in Termonad.Config.Vec

data Sing (z :: IFin n m) where
type Demote (IFin n m) Source # 
Instance details

Defined in Termonad.Config.Vec

type Demote (IFin n m) = IFin n m

toFinIFin :: IFin n m -> Fin n Source #

data HList :: (k -> Type) -> [k] -> Type where Source #

Constructors

EmptyHList :: HList f '[] 
(:<) :: forall (f :: k -> Type) (a :: k) (as :: [k]). f a -> HList f as -> HList f (a ': as) infixr 6 

pattern ConsHList :: (f a :: Type) -> HList f as -> HList f (a ': as) Source #

Data constructor for :<.

data Vec (n :: Peano) :: Type -> Type where Source #

Constructors

EmptyVec :: Vec Z a 
(:*) :: !a -> !(Vec n a) -> Vec (S n) a infixr 6 
Instances
SingI n => Monad (Vec n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(>>=) :: Vec n a -> (a -> Vec n b) -> Vec n b #

(>>) :: Vec n a -> Vec n b -> Vec n b #

return :: a -> Vec n a #

fail :: String -> Vec n a #

Functor (Vec n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

fmap :: (a -> b) -> Vec n a -> Vec n b #

(<$) :: a -> Vec n b -> Vec n a #

SingI n => Applicative (Vec n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

pure :: a -> Vec n a #

(<*>) :: Vec n (a -> b) -> Vec n a -> Vec n b #

liftA2 :: (a -> b -> c) -> Vec n a -> Vec n b -> Vec n c #

(*>) :: Vec n a -> Vec n b -> Vec n b #

(<*) :: Vec n a -> Vec n b -> Vec n a #

Foldable (Vec n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

fold :: Monoid m => Vec n m -> m #

foldMap :: Monoid m => (a -> m) -> Vec n a -> m #

foldr :: (a -> b -> b) -> b -> Vec n a -> b #

foldr' :: (a -> b -> b) -> b -> Vec n a -> b #

foldl :: (b -> a -> b) -> b -> Vec n a -> b #

foldl' :: (b -> a -> b) -> b -> Vec n a -> b #

foldr1 :: (a -> a -> a) -> Vec n a -> a #

foldl1 :: (a -> a -> a) -> Vec n a -> a #

toList :: Vec n a -> [a] #

null :: Vec n a -> Bool #

length :: Vec n a -> Int #

elem :: Eq a => a -> Vec n a -> Bool #

maximum :: Ord a => Vec n a -> a #

minimum :: Ord a => Vec n a -> a #

sum :: Num a => Vec n a -> a #

product :: Num a => Vec n a -> a #

SingI n => Distributive (Vec n) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

distribute :: Functor f => f (Vec n a) -> Vec n (f a) #

collect :: Functor f => (a -> Vec n b) -> f a -> Vec n (f b) #

distributeM :: Monad m => m (Vec n a) -> Vec n (m a) #

collectM :: Monad m => (a -> Vec n b) -> m a -> Vec n (m b) #

SingI n => Representable (Vec n) Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type Rep (Vec n) :: * #

Methods

tabulate :: (Rep (Vec n) -> a) -> Vec n a #

index :: Vec n a -> Rep (Vec n) -> a #

Eq a => Eq (Vec n a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(==) :: Vec n a -> Vec n a -> Bool #

(/=) :: Vec n a -> Vec n a -> Bool #

Ord a => Ord (Vec n a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

compare :: Vec n a -> Vec n a -> Ordering #

(<) :: Vec n a -> Vec n a -> Bool #

(<=) :: Vec n a -> Vec n a -> Bool #

(>) :: Vec n a -> Vec n a -> Bool #

(>=) :: Vec n a -> Vec n a -> Bool #

max :: Vec n a -> Vec n a -> Vec n a #

min :: Vec n a -> Vec n a -> Vec n a #

Show a => Show (Vec n a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Vec n a -> ShowS #

show :: Vec n a -> String #

showList :: [Vec n a] -> ShowS #

SingI n => MonoPointed (Vec n a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

opoint :: Element (Vec n a) -> Vec n a #

MonoFoldable (Vec n a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

ofoldMap :: Monoid m => (Element (Vec n a) -> m) -> Vec n a -> m #

ofoldr :: (Element (Vec n a) -> b -> b) -> b -> Vec n a -> b #

ofoldl' :: (a0 -> Element (Vec n a) -> a0) -> a0 -> Vec n a -> a0 #

otoList :: Vec n a -> [Element (Vec n a)] #

oall :: (Element (Vec n a) -> Bool) -> Vec n a -> Bool #

oany :: (Element (Vec n a) -> Bool) -> Vec n a -> Bool #

onull :: Vec n a -> Bool #

olength :: Vec n a -> Int #

olength64 :: Vec n a -> Int64 #

ocompareLength :: Integral i => Vec n a -> i -> Ordering #

otraverse_ :: Applicative f => (Element (Vec n a) -> f b) -> Vec n a -> f () #

ofor_ :: Applicative f => Vec n a -> (Element (Vec n a) -> f b) -> f () #

omapM_ :: Applicative m => (Element (Vec n a) -> m ()) -> Vec n a -> m () #

oforM_ :: Applicative m => Vec n a -> (Element (Vec n a) -> m ()) -> m () #

ofoldlM :: Monad m => (a0 -> Element (Vec n a) -> m a0) -> a0 -> Vec n a -> m a0 #

ofoldMap1Ex :: Semigroup m => (Element (Vec n a) -> m) -> Vec n a -> m #

ofoldr1Ex :: (Element (Vec n a) -> Element (Vec n a) -> Element (Vec n a)) -> Vec n a -> Element (Vec n a) #

ofoldl1Ex' :: (Element (Vec n a) -> Element (Vec n a) -> Element (Vec n a)) -> Vec n a -> Element (Vec n a) #

headEx :: Vec n a -> Element (Vec n a) #

lastEx :: Vec n a -> Element (Vec n a) #

unsafeHead :: Vec n a -> Element (Vec n a) #

unsafeLast :: Vec n a -> Element (Vec n a) #

maximumByEx :: (Element (Vec n a) -> Element (Vec n a) -> Ordering) -> Vec n a -> Element (Vec n a) #

minimumByEx :: (Element (Vec n a) -> Element (Vec n a) -> Ordering) -> Vec n a -> Element (Vec n a) #

oelem :: Element (Vec n a) -> Vec n a -> Bool #

onotElem :: Element (Vec n a) -> Vec n a -> Bool #

MonoFunctor (Vec n a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

omap :: (Element (Vec n a) -> Element (Vec n a)) -> Vec n a -> Vec n a #

type Rep (Vec n) Source # 
Instance details

Defined in Termonad.Config.Vec

type Rep (Vec n) = Fin n
type Element (Vec n a) Source # 
Instance details

Defined in Termonad.Config.Vec

type Element (Vec n a) = a

pattern ConsVec :: (a :: Type) -> Vec n a -> Vec (S n) a Source #

Data constructor for :*.

genVec_ :: SingI n => (Fin n -> a) -> Vec n a Source #

genVec :: SPeano n -> (Fin n -> a) -> Vec n a Source #

indexVec :: Fin n -> Vec n a -> a Source #

replaceVec :: Sing n -> a -> Vec n a Source #

imapVec :: forall n a b. (Fin n -> a -> b) -> Vec n a -> Vec n b Source #

replaceVec_ :: SingI n => a -> Vec n a Source #

apVec :: (a -> b -> c) -> Vec n a -> Vec n b -> Vec n c Source #

onHeadVec :: (a -> a) -> Vec (S n) a -> Vec (S n) a Source #

dropVec :: Sing m -> Vec (m + n) a -> Vec n a Source #

takeVec :: IFin n m -> Vec n a -> Vec m a Source #

updateAtVec :: Fin n -> (a -> a) -> Vec n a -> Vec n a Source #

setAtVec :: Fin n -> a -> Vec n a -> Vec n a Source #

fromListVec :: Sing n -> [a] -> Maybe (Vec n a) Source #

fromListVec_ :: SingI n => [a] -> Maybe (Vec n a) Source #

unsafeFromListVec :: Sing n -> [a] -> Vec n a Source #

unsafeFromListVec_ :: SingI n => [a] -> Vec n a Source #

type family MatrixTF (ns :: [Peano]) (a :: Type) :: Type where ... Source #

Equations

MatrixTF '[] a = a 
MatrixTF (n ': ns) a = Vec n (MatrixTF ns a) 

newtype Matrix ns a Source #

Constructors

Matrix 

Fields

Instances
SingI ns => Monad (Matrix ns) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(>>=) :: Matrix ns a -> (a -> Matrix ns b) -> Matrix ns b #

(>>) :: Matrix ns a -> Matrix ns b -> Matrix ns b #

return :: a -> Matrix ns a #

fail :: String -> Matrix ns a #

SingI ns => Functor (Matrix ns) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

fmap :: (a -> b) -> Matrix ns a -> Matrix ns b #

(<$) :: a -> Matrix ns b -> Matrix ns a #

SingI ns => Applicative (Matrix ns) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

pure :: a -> Matrix ns a #

(<*>) :: Matrix ns (a -> b) -> Matrix ns a -> Matrix ns b #

liftA2 :: (a -> b -> c) -> Matrix ns a -> Matrix ns b -> Matrix ns c #

(*>) :: Matrix ns a -> Matrix ns b -> Matrix ns b #

(<*) :: Matrix ns a -> Matrix ns b -> Matrix ns a #

SingI ns => Foldable (Matrix ns) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

fold :: Monoid m => Matrix ns m -> m #

foldMap :: Monoid m => (a -> m) -> Matrix ns a -> m #

foldr :: (a -> b -> b) -> b -> Matrix ns a -> b #

foldr' :: (a -> b -> b) -> b -> Matrix ns a -> b #

foldl :: (b -> a -> b) -> b -> Matrix ns a -> b #

foldl' :: (b -> a -> b) -> b -> Matrix ns a -> b #

foldr1 :: (a -> a -> a) -> Matrix ns a -> a #

foldl1 :: (a -> a -> a) -> Matrix ns a -> a #

toList :: Matrix ns a -> [a] #

null :: Matrix ns a -> Bool #

length :: Matrix ns a -> Int #

elem :: Eq a => a -> Matrix ns a -> Bool #

maximum :: Ord a => Matrix ns a -> a #

minimum :: Ord a => Matrix ns a -> a #

sum :: Num a => Matrix ns a -> a #

product :: Num a => Matrix ns a -> a #

SingI ns => Distributive (Matrix ns) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

distribute :: Functor f => f (Matrix ns a) -> Matrix ns (f a) #

collect :: Functor f => (a -> Matrix ns b) -> f a -> Matrix ns (f b) #

distributeM :: Monad m => m (Matrix ns a) -> Matrix ns (m a) #

collectM :: Monad m => (a -> Matrix ns b) -> m a -> Matrix ns (m b) #

SingI ns => Representable (Matrix ns) Source # 
Instance details

Defined in Termonad.Config.Vec

Associated Types

type Rep (Matrix ns) :: * #

Methods

tabulate :: (Rep (Matrix ns) -> a) -> Matrix ns a #

index :: Matrix ns a -> Rep (Matrix ns) -> a #

Eq (MatrixTF ns a) => Eq (Matrix ns a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(==) :: Matrix ns a -> Matrix ns a -> Bool #

(/=) :: Matrix ns a -> Matrix ns a -> Bool #

Num a => Num (Matrix ([] :: [Peano]) a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

(+) :: Matrix [] a -> Matrix [] a -> Matrix [] a #

(-) :: Matrix [] a -> Matrix [] a -> Matrix [] a #

(*) :: Matrix [] a -> Matrix [] a -> Matrix [] a #

negate :: Matrix [] a -> Matrix [] a #

abs :: Matrix [] a -> Matrix [] a #

signum :: Matrix [] a -> Matrix [] a #

fromInteger :: Integer -> Matrix [] a #

Ord (MatrixTF ns a) => Ord (Matrix ns a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

compare :: Matrix ns a -> Matrix ns a -> Ordering #

(<) :: Matrix ns a -> Matrix ns a -> Bool #

(<=) :: Matrix ns a -> Matrix ns a -> Bool #

(>) :: Matrix ns a -> Matrix ns a -> Bool #

(>=) :: Matrix ns a -> Matrix ns a -> Bool #

max :: Matrix ns a -> Matrix ns a -> Matrix ns a #

min :: Matrix ns a -> Matrix ns a -> Matrix ns a #

Show (MatrixTF ns a) => Show (Matrix ns a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

showsPrec :: Int -> Matrix ns a -> ShowS #

show :: Matrix ns a -> String #

showList :: [Matrix ns a] -> ShowS #

SingI ns => MonoFoldable (Matrix ns a) Source # 
Instance details

Defined in Termonad.Config.Vec

Methods

ofoldMap :: Monoid m => (Element (Matrix ns a) -> m) -> Matrix ns a -> m #

ofoldr :: (Element (Matrix ns a) -> b -> b) -> b -> Matrix ns a -> b #

ofoldl' :: (a0 -> Element (Matrix ns a) -> a0) -> a0 -> Matrix ns a -> a0 #

otoList :: Matrix ns a -> [Element (Matrix ns a)] #

oall :: (Element (Matrix ns a) -> Bool) -> Matrix ns a -> Bool #

oany :: (Element (Matrix ns a) -> Bool) -> Matrix ns a -> Bool #

onull :: Matrix ns a -> Bool #

olength :: Matrix ns a -> Int #

olength64 :: Matrix ns a -> Int64 #

ocompareLength :: Integral i => Matrix ns a -> i -> Ordering #

otraverse_ :: Applicative f => (Element (Matrix ns a) -> f b) -> Matrix ns a -> f () #

ofor_ :: Applicative f => Matrix ns a -> (Element (Matrix ns a) -> f b) -> f () #

omapM_ :: Applicative m => (Element (Matrix ns a) -> m ()) -> Matrix ns a -> m () #

oforM_ :: Applicative m => Matrix ns a -> (Element (Matrix ns a) -> m ()) -> m () #

ofoldlM :: Monad m => (a0 -> Element (Matrix ns a) -> m a0) -> a0 -> Matrix ns a -> m a0 #

ofoldMap1Ex :: Semigroup m => (Element (Matrix ns a) -> m) -> Matrix ns a -> m #

ofoldr1Ex :: (Element (Matrix ns a) -> Element (Matrix ns a) -> Element (Matrix ns a)) -> Matrix ns a -> Element (Matrix ns a) #

ofoldl1Ex' :: (Element (Matrix ns a) -> Element (Matrix ns a) -> Element (Matrix ns a)) -> Matrix ns a -> Element (Matrix ns a) #

headEx :: Matrix ns a -> Element (Matrix ns a) #

lastEx :: Matrix ns a -> Element (Matrix ns a) #

unsafeHead :: Matrix ns a -> Element (Matrix ns a) #

unsafeLast :: Matrix ns a -> Element (Matrix ns a) #

maximumByEx :: (Element (Matrix ns a) -> Element (Matrix ns a) -> Ordering) -> Matrix ns a -> Element (Matrix ns a) #

minimumByEx :: (Element (Matrix ns a) -> Element (Matrix ns a) -> Ordering) -> Matrix ns a -> Element (Matrix ns a) #

oelem :: Element (Matrix ns a) -> Matrix ns a -> Bool #

onotElem :: Element (Matrix ns a) -> Matrix ns a -> Bool #

type Rep (Matrix ns) Source # 
Instance details

Defined in Termonad.Config.Vec

type Rep (Matrix ns) = HList Fin ns
type Element (Matrix ns a) Source # 
Instance details

Defined in Termonad.Config.Vec

type Element (Matrix ns a) = a

type MatrixTFSym2 (ns :: [Peano]) (t :: Type) = (MatrixTF ns t :: Type) Source #

data MatrixTFSym1 (ns :: [Peano]) (z :: TyFun Type Type) Source #

Instances
type Apply (MatrixTFSym1 l1 :: TyFun Type Type -> *) (l2 :: Type) Source # 
Instance details

Defined in Termonad.Config.Vec

type Apply (MatrixTFSym1 l1 :: TyFun Type Type -> *) (l2 :: Type) = MatrixTF l1 l2

data MatrixTFSym0 (l :: TyFun [Peano] (Type ~> Type)) Source #

Instances
type Apply MatrixTFSym0 (l :: [Peano]) Source # 
Instance details

Defined in Termonad.Config.Vec

eqSingMatrix :: forall (peanos :: [Peano]) (a :: Type). Eq a => Sing peanos -> Matrix peanos a -> Matrix peanos a -> Bool Source #

ordSingMatrix :: forall (peanos :: [Peano]) (a :: Type). Ord a => Sing peanos -> Matrix peanos a -> Matrix peanos a -> Ordering Source #

compareSingMatrix :: forall (peanos :: [Peano]) (a :: Type) (c :: Type). (a -> a -> c) -> c -> (c -> c -> c) -> Sing peanos -> Matrix peanos a -> Matrix peanos a -> c Source #

fmapSingMatrix :: forall (peanos :: [Peano]) (a :: Type) (b :: Type). Sing peanos -> (a -> b) -> Matrix peanos a -> Matrix peanos b Source #

consMatrix :: Matrix ns a -> Matrix (n ': ns) a -> Matrix (S n ': ns) a Source #

toListMatrix :: forall (peanos :: [Peano]) (a :: Type). Sing peanos -> Matrix peanos a -> [a] Source #

genMatrix :: forall (ns :: [Peano]) (a :: Type). Sing ns -> (HList Fin ns -> a) -> Matrix ns a Source #

genMatrix_ :: SingI ns => (HList Fin ns -> a) -> Matrix ns a Source #

indexMatrix :: HList Fin ns -> Matrix ns a -> a Source #

imapMatrix :: forall (ns :: [Peano]) a b. Sing ns -> (HList Fin ns -> a -> b) -> Matrix ns a -> Matrix ns b Source #

imapMatrix_ :: SingI ns => (HList Fin ns -> a -> b) -> Matrix ns a -> Matrix ns b Source #

onMatrixTF :: (MatrixTF ns a -> MatrixTF ms b) -> Matrix ns a -> Matrix ms b Source #

onMatrix :: (Matrix ns a -> Matrix ms b) -> MatrixTF ns a -> MatrixTF ms b Source #

updateAtMatrix :: HList Fin ns -> (a -> a) -> Matrix ns a -> Matrix ns a Source #

setAtMatrix :: HList Fin ns -> a -> Matrix ns a -> Matrix ns a Source #