Skip to content

Instantly share code, notes, and snippets.

@ghorn
Created February 11, 2015 13:29
Show Gist options
  • Save ghorn/93cb7ebb808fc7535834 to your computer and use it in GitHub Desktop.
Save ghorn/93cb7ebb808fc7535834 to your computer and use it in GitHub Desktop.
haskell has no type-level lambda?
type Compose f g a = f (g a)
type Apply f a = f a
-- This one fails with "Compose has 3 arguments but you gave it 2".
-- All the others work.
x0 :: Apply (Compose f g) a
x0 = undefined
x1 :: (Compose f g) a
x1 = undefined
newtype Compose' f g a = Compose' f (g a)
newtype Apply' f a = Apply' (f a)
x3 :: Apply' (Compose' f g) a
x3 = undefined
x4 :: (Compose' f g) a
x4 = undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment