Skip to content

Instantly share code, notes, and snippets.

@WillNess
Created August 19, 2013 12:17
Show Gist options
  • Select an option

  • Save WillNess/6268513 to your computer and use it in GitHub Desktop.

Select an option

Save WillNess/6268513 to your computer and use it in GitHub Desktop.
pointfree diffs
Prelude Control.Arrow Control.Monad Control.Applicative> (tail >>= zip) [1..5]
[(2,1),(3,2),(4,3),(5,4)]
Prelude Control.Arrow Control.Monad Control.Applicative> liftM2 zip tail id [1..5]
[(2,1),(3,2),(4,3),(5,4)]
Prelude Control.Arrow Control.Monad Control.Applicative> liftA2 zip tail id [1..5]
[(2,1),(3,2),(4,3),(5,4)]
Prelude Control.Arrow Control.Monad Control.Applicative> (zip.tail) <*> id $ [1..5]
[(2,1),(3,2),(4,3),(5,4)]
Prelude Control.Arrow Control.Monad Control.Applicative> zip <$> tail <*> id $ [1..5]
[(2,1),(3,2),(4,3),(5,4)]
Prelude Control.Arrow Control.Monad Control.Applicative> join (zip.tail) [1..5]
[(2,1),(3,2),(4,3),(5,4)]
Prelude Control.Arrow Control.Monad Control.Applicative> join (zip <$> tail) [1..5]
[(2,1),(3,2),(4,3),(5,4)]
Prelude Control.Arrow Control.Monad Control.Applicative>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment