Created
February 10, 2017 21:53
-
-
Save Leonidas-from-XIV/98efb6bb6fea7c8a8b33cfa55c6f5f4c to your computer and use it in GitHub Desktop.
with
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
module type Mapper = sig | |
type 'a t | |
val map : ('a -> 'b) -> 'a t -> 'b t | |
end | |
module OptionMapper : Mapper | |
with type 'a t = 'a option | |
= struct | |
type 'a t = 'a option | |
let map f = function | |
| Some a -> Some (f a) | |
| _ -> None | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment