Skip to content

Instantly share code, notes, and snippets.

@slogsdon
Created October 3, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slogsdon/5d7191bc787aa1840b8d to your computer and use it in GitHub Desktop.
Save slogsdon/5d7191bc787aa1840b8d to your computer and use it in GitHub Desktop.
# @spec Control.Applicative.apply(Control.Applicative.t, Control.Functor.t) :: Control.Applicative.t
# @spec Control.Monad.bind(Control.Monad.t, (term -> Control.Monad.t)) :: Control.Monad.t
import Data.Maybe
alias Control.Applicative, as: A
import Control.Monad
(&(&1 + 2))
|> just
|> A.apply(just(5))
|> bind(&(&1 * 2 |> just))
# %Data.Maybe{just: 14, nothing: nil}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment