Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type family and class definitions for dealing with functions.
Many of these definitions are similar to the ones that deal with tuples, in which case it refers to the documentation in Control.IndexT.Tuple.
Also see the Control.IndexT module description for an overview.
- type family ResultT (n :: Nat) a
- type family FuncN (n :: Nat) a
- type FuncConstraint n a = a ~ FuncN n a
- type HomoFuncConstraint n a = (HomoArgFuncConstraint n a, ResultT n a ~ IndexT 0 a)
- type family HomoArgFuncConstraint (n :: Nat) a :: Constraint
- class FuncConstraint n a => IsFunc n a
- class HomoFuncConstraint n a => IsHomoFunc n a
- class HomoArgFuncConstraint n a => IsHomoArgFunc n a
Documentation
type family ResultT (n :: Nat) a Source #
ResultT
is used to get the result type of functions, which IndexT
can not be used for as discussed in
it's documentation.
ResultT n t
gets the result of t
treated as an n
argument function. For example:
ResultT 2 (a -> b -> c) == c
note that:
ResultT 2 (a -> b -> c -> d) == c -> d
which makes sense, as the result of applying two arguments to this function is (c -> d)
.
type ResultT 0 a Source # | |
type ResultT 1 (_ -> a) Source # | |
type ResultT 2 (_1 -> _ -> a) Source # | |
type ResultT 3 (_2 -> _1 -> _ -> a) Source # | |
type ResultT 4 (_3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 5 (_4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 6 (_5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 7 (_6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 8 (_7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 9 (_8 -> _7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 10 (_9 -> _8 -> _7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 11 (_10 -> _9 -> _8 -> _7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 12 (_11 -> _10 -> _9 -> _8 -> _7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 13 (_12 -> _11 -> _10 -> _9 -> _8 -> _7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 14 (_13 -> _12 -> _11 -> _10 -> _9 -> _8 -> _7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type ResultT 15 (_14 -> _13 -> _12 -> _11 -> _10 -> _9 -> _8 -> _7 -> _6 -> _5 -> _4 -> _3 -> _2 -> _1 -> _ -> a) Source # | |
type family FuncN (n :: Nat) a Source #
Like TupleN
, but for functions.
type FuncN 0 a Source # | |
type FuncN 1 a Source # | |
type FuncN 2 a Source # | |
type FuncN 3 a Source # | |
type FuncN 4 a Source # | |
type FuncN 5 a Source # | |
type FuncN 6 a Source # | |
type FuncN 7 a Source # | |
type FuncN 8 a Source # | |
type FuncN 9 a Source # | |
type FuncN 10 a Source # | |
type FuncN 11 a Source # | |
type FuncN 12 a Source # | |
type FuncN 13 a Source # | |
type FuncN 14 a Source # | |
type FuncN 15 a Source # | |
type FuncConstraint n a = a ~ FuncN n a Source #
Like TupleConstraint
, but for functions.
type HomoFuncConstraint n a = (HomoArgFuncConstraint n a, ResultT n a ~ IndexT 0 a) Source #
Like HomoTupleConstraint
, but for functions, where all arguments and the result type are the same.
type family HomoArgFuncConstraint (n :: Nat) a :: Constraint Source #
Like HomoFuncConstraint
, but only constrains all the arguments to be the same type, not the result.
type HomoArgFuncConstraint 0 a Source # | |
type HomoArgFuncConstraint 1 a Source # | |
type HomoArgFuncConstraint 2 a Source # | |
type HomoArgFuncConstraint 3 a Source # | |
type HomoArgFuncConstraint 4 a Source # | |
type HomoArgFuncConstraint 5 a Source # | |
type HomoArgFuncConstraint 6 a Source # | |
type HomoArgFuncConstraint 7 a Source # | |
type HomoArgFuncConstraint 8 a Source # | |
type HomoArgFuncConstraint 9 a Source # | |
type HomoArgFuncConstraint 10 a Source # | |
type HomoArgFuncConstraint 11 a Source # | |
type HomoArgFuncConstraint 12 a Source # | |
type HomoArgFuncConstraint 13 a Source # | |
type HomoArgFuncConstraint 14 a Source # | |
type HomoArgFuncConstraint 15 a Source # | |
class FuncConstraint n a => IsFunc n a Source #
Like IsTuple
, but for functions.
FuncConstraint n a => IsFunc n a Source # | |
class HomoFuncConstraint n a => IsHomoFunc n a Source #
Like IsHomoTuple
, but for functions.
HomoFuncConstraint n a => IsHomoFunc n a Source # | |
class HomoArgFuncConstraint n a => IsHomoArgFunc n a Source #
A classed based constraint for HomoArgFuncConstraint
.
HomoArgFuncConstraint n a => IsHomoArgFunc n a Source # | |