Module
Transit.Class.CurryN
- Package
- purescript-transit
- Repository
- m-bock/purescript-transit
A type class for converting functions that take nested tuple arguments into curried functions.
Example:
f :: Int /\ String /\ Unit -> String
f (x /\ s /\ _) = s <> show x
curried :: Int -> String -> String
curried = curryN f
#CurryN Source
class CurryN args result curried | args result -> curried, args curried -> result whereConverts a function from nested tuple arguments to a curried function.
args: The nested tuple type of arguments (must end withUnit)result: The return type of the functioncurried: The curried function type
Members
curryN :: (args -> result) -> curried
Instances
- Modules
- Transit
- Transit.
Class. CheckReturn - Transit.
Class. CurryN - Transit.
Class. MkHandlerLookup - Transit.
Class. MkUpdate - Transit.
Core - Transit.
DSL - Transit.
Data. DotLang - Transit.
Data. Graph - Transit.
Data. Html - Transit.
Data. MaybeChurch - Transit.
Data. Table - Transit.
HandlerLookup - Transit.
Render. Graphviz - Transit.
Render. Theme - Transit.
Render. TransitionTable - Transit.
StateGraph - Transit.
VariantUtils
Base case: when the tuple is
Unit, the function has no arguments and we simply apply it tounit.