Last active
September 29, 2017 13:59
-
-
Save Octachron/05eb7b1ccead65fb1cada5c03cc40dd2 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 'a succ = private S | |
type z = private Z | |
type ('elt,'size) t = | |
| []: ('elt, z) t | |
| (::): 'elt * ('elt,'size) t -> ('elt, 'size succ) t | |
let rec map2: type size. ('elt -> 'elt2 -> 'elt3) -> ('elt,size) t -> ('elt2,size) t -> ('elt3,size) t = fun f x y -> | |
match x,y with | |
| a :: q, b :: q' -> (f a b) :: map2 f q q' | |
| [], [] -> [] | |
| _ -> . | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment