Created
June 24, 2009 15:50
-
-
Save dgfitch/135349 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun (f : 'a * Structure -> 'a * Structure) (state : 'a) (list : Structure list) -> | |
let g f (state,_) s = f (state, s) | |
let states, structures = | |
list | |
|> List.scan (g f) (state,Empty) | |
|> List.unzip | |
// got to be a better way to pop the end off a list | |
let final_state = states.[List.length states - 1] | |
final_state, structures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment