Created
July 15, 2015 14:10
-
-
Save gsg/c4b1a07229a9d17bf842 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
type (_, _) arr = | |
| Const : 'a -> (_, 'a) arr | |
| Comp : ('a, 'b) arr * ('b, 'c) arr -> ('a, 'c) arr | |
let rec eval : type a b . a -> (a, b) arr -> b = | |
fun x arr -> | |
match arr with | |
| Const a -> a | |
| Comp (u, v) -> eval (eval x u) v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment