Skip to content

Instantly share code, notes, and snippets.

@BekaValentine
Created April 25, 2014 17:42
Show Gist options
  • Select an option

  • Save BekaValentine/11297501 to your computer and use it in GitHub Desktop.

Select an option

Save BekaValentine/11297501 to your computer and use it in GitHub Desktop.
args \ env size | 1
----------------|---------------------------------------------------------------
1 | \f x a -> f a (x a) = ap
----------------|---------------------------------------------------------------
2 | \f x y a -> f a (x a) (y a) = (ap .) . ap
----------------|---------------------------------------------------------------
3 | \f x y z a -> f a (x a) (y a) (z a) = (((ap .) . ap) .) . ap
args \ env size | 2
----------------|----------------------------------------------------------------------------------------------
1 | \f x a b -> f a b (x a b) = liftM2 ap
----------------|----------------------------------------------------------------------------------------------
2 | \f x y a b -> f a b (x a b) (y a b) = (liftM2 ap .) . liftM2 ap
----------------|----------------------------------------------------------------------------------------------
3 | \f x y z a b -> f a b (x a b) (y a b) (z a b) = (((liftM2 ap .) . liftM2 ap) .) . liftM2 ap
args \ env size | 3
----------------|-----------------------------------------------------------------------------------------------------------------------------------
1 | \f x a b c -> f a b c (x a b c) = liftM2 (liftM2 ap)
----------------|-----------------------------------------------------------------------------------------------------------------------------------
2 | \f x y a b c -> f a b c (x a b c) (y a b c) = (liftM2 (liftM2 ap) .) . liftM2 (liftM2 ap)
----------------|-----------------------------------------------------------------------------------------------------------------------------------
3 | \f x y z a b c -> f a b c (x a b c) (y a b c) (z a b c) = (((liftM2 (liftM2 ap) .) . liftM2 (liftM2 ap)) .) . liftM2 (liftM2 ap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment