Portability | portable |
---|---|

Stability | experimental |

Maintainer | christian@ponies.io |

Safe Haskell | Safe-Inferred |

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

- rotate1 :: (a -> b) -> a -> b
- rotate2 :: (a -> b -> c) -> b -> a -> c
- rotate3 :: (a -> b -> c -> d) -> c -> a -> b -> d
- rotate4 :: (a -> b -> c -> d -> e) -> d -> a -> b -> c -> e
- rotate5 :: (a -> b -> c -> d -> e -> f) -> e -> a -> b -> c -> d -> f
- rotate6 :: (a -> b -> c -> d -> e -> f -> g) -> f -> a -> b -> c -> d -> e -> g
- rotate7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> g -> a -> b -> c -> d -> e -> f -> h
- rotate8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> h -> a -> b -> c -> d -> e -> f -> g -> i
- rotate9 :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> i -> a -> b -> c -> d -> e -> f -> g -> h -> j
- flip1 :: (a -> b) -> a -> b
- flip2 :: (a -> b -> c) -> b -> a -> c
- flip3 :: (a -> b -> c -> d) -> c -> b -> a -> d
- flip4 :: (a -> b -> c -> d -> e) -> d -> c -> b -> a -> e
- flip5 :: (a -> b -> c -> d -> e -> f) -> e -> d -> c -> b -> a -> f
- flip6 :: (a -> b -> c -> d -> e -> f -> g) -> f -> e -> d -> c -> b -> a -> g
- flip7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> g -> f -> e -> d -> c -> b -> a -> h
- flip8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> h -> g -> f -> e -> d -> c -> b -> a -> i
- flip9 :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> i -> h -> g -> f -> e -> d -> c -> b -> a -> j

# Rotation

Rotate all arguments right one position

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

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