Skip to content

Instantly share code, notes, and snippets.

@mcmillhj mcmillhj/type-example.sml
Last active Jan 4, 2017

Embed
What would you like to do?
(* fn: ('a -> 'b) -> 'a list -> 'b list *)
fun accumulate _ [] = []
| accumulate f (x::xs) = f x :: accumulate f xs
(* fn: ('a -> 'b) * 'a -> 'b list *)
fun accumulate (f: ('a -> 'b), xs: 'a list): 'b list =
raise Fail "'accumulate' has not been implemented"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.