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
# open Classify ;; | |
# let feature_map = function | `shortbread -> 0 | `lager -> 1 | `whiskey -> 2 | `porridge -> 3 | `football-> 4 ;; | |
val feature_map : [< `football | `lager | `porridge | `shortbread | `whiskey ] -> int = <fun> | |
# let data = | |
[ | |
(`English, [`whiskey; `porridge; `football]); | |
(`English, [`shortbread; `whiskey; `porridge]); | |
(`English, [`shortbread; `lager; `football]); | |
(`English, [`shortbread; `lager]); | |
(`English, [`lager; `football]); |
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 ('b , 'a) foo = [ `Foo of 'a | |
| `Bar of 'b | |
] | |
type ('a, 'c) ani = [ (('a, 'c) foo) | |
| `Cat of 'a | |
| `Dog of 'a | |
] | |
let foo_to_str = function |
NewerOlder