curry package:vinyl

Provides combinators for currying and uncurrying functions over arbitrary vinyl records.
N-ary version of curry over functorial records. Example specialized signatures:
rcurry :: (Rec Maybe '[Int, Double] -> Bool) -> Maybe Int -> Maybe Double -> Bool
rcurry :: (Rec (Either Int) '[Double, String, ()] -> Int) -> Either Int Double -> Either Int String -> Either Int () -> Int
rcurry :: (Rec f '[] -> Bool) -> Bool

N-ary version of curry over pure records. Example specialized signatures:
rcurry' :: (Rec Identity '[Int, Double] -> Bool) -> Int -> Double -> Bool
rcurry' :: (Rec Identity '[Double, String, ()] -> Int) -> Double -> String -> () -> Int
rcurry' :: (Rec Identity '[] -> Bool) -> Bool

N-ary version of uncurry over functorial records. Example specialized signatures:
runcurry :: (Maybe Int -> Maybe Double -> String) -> Rec Maybe '[Int, Double] -> String
runcurry :: (IO FilePath -> String) -> Rec IO '[FilePath] -> String
runcurry :: Int -> Rec f '[] -> Int
N-ary version of uncurry over pure records. Example specialized signatures:
runcurry' :: (Int -> Double -> String) -> Rec Identity '[Int, Double] -> String
runcurry' :: Int -> Rec Identity '[] -> Int
Example usage:
f :: Rec Identity '[Bool, Int, Double] -> Either Int Double
f = runcurry' $ b x y -> if b then Left x else Right y
Lift an N-ary function over types in g to work over a record of Composed Applicative computations. A more general version of runcurryA'. Example specialized signatures:
runcurryA :: (g x -> g y -> a) -> Rec (Compose Maybe g) '[x, y] -> Maybe a
Lift an N-ary function to work over a record of Applicative computations.
>>> runcurryA' (+) (Just 2 :& Just 3 :& RNil)
Just 5
>>> runcurryA' (+) (Nothing :& Just 3 :& RNil)
Nothing
Apply an uncurried function to a Rec like runcurry except the function enjoys a type simplified by the XData machinery that strips away type-induced noise like Identity, Compose, and ElField.
Apply an uncurried function to an XRec.