Created
July 4, 2014 12:33
-
-
Save Octachron/253d8be9b3cc3b2ea618 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
type (_,_) nuple = | |
| Z : (unit,unit) nuple | |
| P: ('a * ('b,'c) nuple) -> ('a, ('b,'c) nuple ) nuple | |
let p=P(1, P("try", P( [4,5], Z))) | |
let rec map: 'a 'b 'c 'd 'e 'f. ('a,'b) nuple -> ('c,'d) nuple ->('e,'f) nuple= | |
fun fs ps -> match (fs,ps ) with | |
| P(f,fs), P(p,ps) -> P(f p, map fs ps) | |
| Z, Z -> Z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment