Skip to content

Instantly share code, notes, and snippets.

@Lysxia
Created July 28, 2018 13:14
Show Gist options
  • Save Lysxia/97fbf2514cfb98878d6a9903acfb9ee3 to your computer and use it in GitHub Desktop.
Save Lysxia/97fbf2514cfb98878d6a9903acfb9ee3 to your computer and use it in GitHub Desktop.
class Uncurry f ts r where
uncurry_ :: f -> NP I ts -> r
instance Uncurry f xs r => Uncurry (t -> f) (t ': ts) r where
uncurry_ f (a :* as) = uncurry_ (f a) as
instance (s ~ r) => Uncurry s '[] r where
uncurry_ z Nil = z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment