Copyright | (c) Justus Adam, 2015 |
---|---|
License | BDS3 |
Maintainer | dev@justus.science |
Stability | experimental |
Portability | POSIX, Windows |
Safe Haskell | Safe |
Language | Haskell2010 |
- stuff :: (α -> α -> β) -> α -> β
- stuff2 :: (α -> α -> β) -> α -> β
- stuff3 :: (α -> α -> α -> β) -> α -> β
- stuff4 :: (α -> α -> α -> α -> β) -> α -> β
- stuff5 :: (α -> α -> α -> α -> α -> β) -> α -> β
- const1 :: α -> β -> α
- const2 :: γ -> α -> β -> γ
- const3 :: δ -> α -> β -> γ -> δ
- const4 :: ε -> α -> β -> γ -> δ -> ε
- const5 :: ζ -> α -> β -> γ -> δ -> ε -> ζ
Stuffing functions
Functions from the stuffing family are used when a function takes several consecutive parameters of the same type.
Sometimes it is desirable to call some of these arguments with the same value and those functions here allow you to do that in the "do-not-repeat-yourself" way.
Multiple argument stffing can also be achieved by chaining stuff
.
stuff4 f == (stuff . stuff . stuff) f
In theory stuff1
would be id
.
Constant functions
Functions from the const family behave very much like const
function
from prelude. But for more arguments.
The constN function takes a value and N arguments of arbitrary type returning the value after all arguments have been supplied.
The same effect can be reached by chaining const
but does not look as good.
const3 v == (const . const . const) v
Alias for the const
function from prelude in the const function family
naming scheme.