IdrisDoc: Data.Composition

Data.Composition

A bunch of function composition extras, inspired by the Haskell package of the same name.

on : (a -> a -> b) -> (c -> a) -> c -> c -> b
(.*****) : (g -> h) -> (a -> b -> c -> d -> e -> f -> g) -> a -> b -> c -> d -> e -> f -> h
Fixity
Left associative, precedence 9
(.****) : (f -> g) -> (a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> g
Fixity
Left associative, precedence 9
(.***) : (e -> f) -> (a -> b -> c -> d -> e) -> a -> b -> c -> d -> f
Fixity
Left associative, precedence 9
(.**) : (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> e
Fixity
Left associative, precedence 9
(.*) : (c -> d) -> (a -> b -> c) -> a -> b -> d

Composition when one function has arity > 1

Instead of f = \x, y => 2 * y + x, we can write f = (*2) .* (+)

Fixity
Left associative, precedence 9
(.$) : (a -> a -> b) -> a -> b

Infix equivalent to 'on'

Fixity
Left associative, precedence 9
(-.*****) : (h -> f) -> (a -> b -> c -> d -> e -> f -> g) -> a -> b -> c -> d -> e -> h -> g
Fixity
Left associative, precedence 9
(-.****) : (g -> e) -> (a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> g -> f
Fixity
Left associative, precedence 9
(-.***) : (f -> d) -> (a -> b -> c -> d -> e) -> a -> b -> c -> f -> e
Fixity
Left associative, precedence 9
(-.**) : (e -> c) -> (a -> b -> c -> d) -> a -> b -> e -> d

Composition on the last argument rather than the return value

Fixity
Left associative, precedence 9
(-.*) : (d -> b) -> (a -> b -> c) -> a -> d -> c

The Oedipus combinator

Fixity
Left associative, precedence 9
(-.) : (a -> b) -> (b -> c) -> a -> c

Backwards function composition

Fixity
Left associative, precedence 9
(*.) : (a -> b -> c) -> (c -> d) -> a -> b -> d
Fixity
Left associative, precedence 9
(**.) : (a -> b -> c -> d) -> (d -> e) -> a -> b -> c -> e
Fixity
Left associative, precedence 9
(***.) : (a -> b -> c -> d -> e) -> (e -> f) -> a -> b -> c -> d -> f
Fixity
Left associative, precedence 9
(****.) : (a -> b -> c -> d -> e -> f) -> (f -> g) -> a -> b -> c -> d -> e -> g
Fixity
Left associative, precedence 9
(*****.) : (a -> b -> c -> d -> e -> f -> g) -> (g -> h) -> a -> b -> c -> d -> e -> f -> h
Fixity
Left associative, precedence 9
(&~~~) : (a -> b -> c -> d -> e) -> d -> c -> b -> a -> e
Fixity
Left associative, precedence 9
(&~~) : (a -> b -> c -> d) -> c -> b -> a -> d
Fixity
Left associative, precedence 9
(&~) : (a -> b -> c) -> b -> a -> c
Fixity
Left associative, precedence 9
(&) : a -> (a -> b) -> b

Backwards function application

Fixity
Left associative, precedence 9