flippers-1.0.1: Variations on flip for multiple arguments

Portabilityportable
Stabilityexperimental
Maintainerchristian@ponies.io
Safe HaskellSafe-Inferred

Data.Function.Flippers

Contents

Description

This module provides functions to rearrange arguments, such as rotate4 and flip4. Compose them to achive whatever ordering you like.

Synopsis

Rotation

Rotate all arguments right one position

rotate1 :: (a -> b) -> a -> bSource

Does nothing, id

rotate2 :: (a -> b -> c) -> b -> a -> cSource

Move the second argument to the first place

rotate3 :: (a -> b -> c -> d) -> c -> a -> b -> dSource

Move the third argument to the first place

rotate4 :: (a -> b -> c -> d -> e) -> d -> a -> b -> c -> eSource

Move the fourth argument to the first place

rotate5 :: (a -> b -> c -> d -> e -> f) -> e -> a -> b -> c -> d -> fSource

Move the fifth argument to the first place

rotate6 :: (a -> b -> c -> d -> e -> f -> g) -> f -> a -> b -> c -> d -> e -> gSource

Move the sixth argument to the first place

rotate7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> g -> a -> b -> c -> d -> e -> f -> hSource

Move the seventh argument to the first place

rotate8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> h -> a -> b -> c -> d -> e -> f -> g -> iSource

Move the eight argument to the first place

rotate9 :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> i -> a -> b -> c -> d -> e -> f -> g -> h -> jSource

Move the ninth argument to the first place

Flipping

Reverse the order of all arguments

flip1 :: (a -> b) -> a -> bSource

Does nothing, id

flip2 :: (a -> b -> c) -> b -> a -> cSource

Reverse both arguments, same as rotate2

flip3 :: (a -> b -> c -> d) -> c -> b -> a -> dSource

Reverse three arguments

flip4 :: (a -> b -> c -> d -> e) -> d -> c -> b -> a -> eSource

Reverse four arguments

flip5 :: (a -> b -> c -> d -> e -> f) -> e -> d -> c -> b -> a -> fSource

Reverse five arguments

flip6 :: (a -> b -> c -> d -> e -> f -> g) -> f -> e -> d -> c -> b -> a -> gSource

Reverse six arguments

flip7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> g -> f -> e -> d -> c -> b -> a -> hSource

Reverse seven arguments

flip8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> h -> g -> f -> e -> d -> c -> b -> a -> iSource

Reverse eight arguments

flip9 :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> i -> h -> g -> f -> e -> d -> c -> b -> a -> jSource

Reverse nine arguments