Skip to content

Instantly share code, notes, and snippets.

@Ball
Created October 19, 2009 01:30
Show Gist options
  • Save Ball/213010 to your computer and use it in GitHub Desktop.
Save Ball/213010 to your computer and use it in GitHub Desktop.
type expression =
| Empty
| Number of int
let expression stream =
match stream with
| [] -> Empty, stream
| h::t -> Number( Int32.Parse(h)), t
let evaluate expr =
match expr with
| Empty -> 0
| Number(a) -> a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment