Skip to content

Instantly share code, notes, and snippets.

@reactormonk
Forked from Lysxia/Uncurry.hs
Created July 28, 2018 13:24
Show Gist options
  • Save reactormonk/c4dd738b4f23281b6ab35b53c8661c91 to your computer and use it in GitHub Desktop.
Save reactormonk/c4dd738b4f23281b6ab35b53c8661c91 to your computer and use it in GitHub Desktop.
class Uncurry fun types r where
uncurryNP :: fun -> NP I types -> r
instance forall fun r t types.
( Uncurry fun types r
) => Uncurry (t -> fun) (t ': types) r where
uncurryNP f ((I a) :* as) = uncurryNP (f a) as
instance (s ~ r) => Uncurry s '[] r where
uncurryNP z Nil = z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment