Skip to content

Instantly share code, notes, and snippets.

@forki
Created August 15, 2011 14:36
Show Gist options
  • Select an option

  • Save forki/1146878 to your computer and use it in GitHub Desktop.

Select an option

Save forki/1146878 to your computer and use it in GitHub Desktop.
A simple monad which encapsulates Infinity
// Define the monad
type 'a Result =
| Value of 'a
| Infinite
let bindF r (f: 'a -> 'a Result) =
match r with
| Value x -> f x
| Infinite -> Infinite
let returnF = id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment