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
| \newcount \temp \newcount \fone \newcount \ftwo \newcount \counter | |
| \newcommand{\fibonacci}[1]{ | |
| \counter=#1 | |
| \fone=1 | |
| \ftwo=1 | |
| \temp=0 | |
| \the\fone, \the\ftwo | |
| \fibloop | |
| } |
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 Propagation = struct | |
| type _ t = | |
| IntLit : int -> int t | |
| | BoolLit : bool -> bool t | |
| let check : type s. s t -> s = function | |
| | IntLit n -> n | |
| | BoolLit b -> b | |
| let check : type s. s t -> s = fun x -> |
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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| .node { | |
| font: 300 11px "Helvetica Neue", Helvetica, Arial, sans-serif; | |
| fill: #bbb; | |
| } | |
| .node:hover { |
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
| wget http://download.gmane.org/gmane.comp.lang.caml.inria/3399/6399 | |
| sleep 60 | |
| wget http://download.gmane.org/gmane.comp.lang.caml.inria/6399/9399 | |
| sleep 60 | |
| wget http://download.gmane.org/gmane.comp.lang.caml.inria/9399/12399 | |
| sleep 60 | |
| wget http://download.gmane.org/gmane.comp.lang.caml.inria/12399/15399 | |
| sleep 60 | |
| wget http://download.gmane.org/gmane.comp.lang.caml.inria/15399/18399 | |
| sleep 60 |
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 HList = struct | |
| type (_, _) hlist = | |
| | Empty : ('a, 'a) hlist | |
| | Cons : 'c * ('a, 'b) hlist -> ('c -> 'a, 'b) hlist | |
| let cons : type a b c. c -> (a, b) hlist -> (c -> a, b) hlist = | |
| fun h tl -> Cons (h, tl) | |
| let hd : type a b c. (c -> a, b) hlist -> c option = function | |
| | Empty -> None |
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
| (* by Jeremy Yallop *) | |
| (** The applicative interface *) | |
| module type APPLICATIVE = | |
| sig | |
| type +'a t | |
| val pure : 'a -> 'a t | |
| val (<*>) : ('a -> 'b) t -> 'a t -> 'b t | |
| end |
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
| (* parser generated from ``let seq_parser = (lit 'c') <~> (lit 'd')`` *) | |
| fun s_178 -> | |
| let res1_182 = | |
| let ix_179 = s_178.Sparser.BasicFParser.index in | |
| let f_180 = Sparser.BasicFParser.Failure s_178 in | |
| if ix_179 < s_178.Sparser.BasicFParser.length | |
| then | |
| let e1_181 = (s_178.Sparser.BasicFParser.input).[ix_179] in | |
| (if e1_181 = 'c' | |
| then |
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
| let gen () = | |
| let t2pc = ref (fun _ -> assert false) in | |
| let t3pc = ref (fun _ -> assert false) in | |
| let anonpc = ref (fun _ -> assert false) in | |
| let _ = t2pc := fun s -> | |
| let res1 = !t3pc s in | |
| match res1 with | |
| | Success (arr, s) -> Success ((A arr), s) | |
| | Failure _ -> |
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 t2 = A of t3 | C of char and t3 = t2 | |
| let rec t2_parser = NT (lazy ( | |
| either [(fun arr -> A arr) <*> arr_parser; | |
| ((fun c -> C c) <*> lit 'c')])) | |
| and arr_parser = NT (lazy ( | |
| (lit '[') >> t2_parser << (lit ']'))) |
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 Eq = struct | |
| type (_, _) t = Refl : ('a, 'a) t | |
| end | |
| type _ nttype = .. | |
| type 'a typeable = { | |
| constructor : 'a nttype; | |
| eq : 'b. 'b nttype -> ('a, 'b) Eq.t option | |
| } |