ja-base-extra-0.1.0.0: Extra functions I require in base

Copyright(c) Justus Adam, 2015
LicenseBDS3
Maintainerdev@justus.science
Stabilityexperimental
PortabilityPOSIX, Windows
Safe HaskellSafe
LanguageHaskell2010

Data.Function.JAExtra

Contents

Description

 

Synopsis

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.

stuff :: (α -> α -> β) -> α -> β Source

Alias for stuff2

stuff2 :: (α -> α -> β) -> α -> β Source

stuff3 :: (α -> α -> α -> β) -> α -> β Source

stuff4 :: (α -> α -> α -> α -> β) -> α -> β Source

stuff5 :: (α -> α -> α -> α -> α -> β) -> α -> β Source

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

const1 :: α -> β -> α Source

Alias for the const function from prelude in the const function family naming scheme.

const2 :: γ -> α -> β -> γ Source

const3 :: δ -> α -> β -> γ -> δ Source

const4 :: ε -> α -> β -> γ -> δ -> ε Source

const5 :: ζ -> α -> β -> γ -> δ -> ε -> ζ Source