Reverse the arguments of arbitrary functions.

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Anselm Jonas Scholl

Reversing function arguments

This module provides the reverseArgs function which flips the arguments of a function of arbitrary arity. The return value of the flipped function can not be fully polymorphic as this could imply it is a function.


myFlip :: (a -> b -> c -> d -> [e]) -> d -> c -> b -> a -> [e]
myFlip = reverseArgs

However, if you supply a proof (of the form IsFun a ~ 'False) that a is not a function, you can also return a polymorphic type.


myFlip :: IsFun e ~ 'False => (a -> b -> c -> d -> e) -> d -> c -> b -> a -> e
myFlip = reverseArgs
Depends on 1 package:
Used by 1 package:
comments powered byDisqus