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
module Button = { | |
type size = | |
| Small | |
| | |
| Medium | |
| Large; | |
}; | |
module Button = { | |
type size = |
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 other; | |
let compareOther: (other, other) => int = assert(false); | |
let equalOther: (other, other) => bool = assert(false); | |
type runtimeValue = | |
| Undefined | |
| BoxUndefined(int) | |
| Null | |
| Other(other); |
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
let foo = (~name, ~surname, _) => { | |
print_string("name: " ++ name); | |
print_string("surname: " ++ surname); | |
}; | |
module State: { | |
type t('a); | |
let init: 'a => t('a); | |
let get: t('a) => 'a; | |
let set: (t('a), 'a) => unit; |
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
module HookTypes = { | |
type state('a); | |
type effect; | |
type t('t); | |
let addState: (t('t), ~state: 'state) => t(('t, state('state))) = | |
(x, ~state as _) => Obj.magic(x); | |
let addEffect: t('t) => t(('t, effect)) = Obj.magic; | |
}; |
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
module State: { | |
type t('a); | |
let createSlot: (t('a) => 'b) => 'b; | |
let useHook: ('a, t('a)) => ('a, 'a => unit); | |
} = { | |
type t('a) = ref(option('a)); | |
let createSlot = cont => cont(ref(None)); | |
let useHook = (initial: 'a, slot: t('a)) => { | |
let state = | |
switch (slot^) { |
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
module type SlotsType = { | |
type t('slot, 'nextSlots); | |
let create: unit => t('slot, 'nextSlots); | |
let use: | |
( | |
~default: 'slot, | |
('slot, t('slot2, 'nextSlots)) => 'c, | |
t('slot, t('slot2, 'nextSlots)) | |
) => | |
'c; |
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
module type SlotsType = { | |
type t('slot, 'nextSlots); | |
let create: unit => t('slot, 'nextSlots); | |
let use: | |
(~default: 'slot, t('slot, t('slot2, 'nextSlots))) => | |
('slot, t('slot2, 'nextSlots)); | |
}; | |
module Slots: SlotsType = { | |
type t('slot, 'nextSlots) = ref(option(('slot, 'nextSlots))); |
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
and parseInt = (p: Parser.t) => { | |
let res = | |
switch (p.token) { | |
| Int(n) => n | |
| _ => | |
Parser.err(p, "integer expected"); | |
(-1); | |
}; | |
Parser.next(p); | |
res; |
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
$ Blacklist=test ../node_modules/.bin/gentype -dce-cmt . | |
Warning Dead Analysis Cycle | |
stdlib-406/lexing.mli | |
Results for stdlib-406/lexing.mli could be inaccurate because of circular references | |
Warning Dead Analysis Cycle | |
stdlib-406/pervasives.mli | |
Results for stdlib-406/pervasives.mli could be inaccurate because of circular references |
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
module M : sig end = | |
struct | |
let x0 = fun _ -> [0] | |
let x1 = fun _ -> [1] | |
let x2 = fun _ -> [2] | |
let x3 = fun _ -> [3] | |
let x4 = fun _ -> [4] | |
let x5 = fun _ -> [5] | |
let x6 = fun _ -> [6] | |
let x7 = fun _ -> [7] |
OlderNewer