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 Ex1 = struct | |
(* まず相互再帰した型を一モジュールで作り、その後別モジュールに分離する例 *) | |
module AB = struct | |
type a = A | AA of b | |
and b = B | BB of a | |
let a_f = function A -> B | AA b -> b | |
let b_f = function B -> A | BB a -> a | |
end |
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 rec fib = function | 0 -> 0 | 1 -> 1 | n -> fib (n-1) + fib (n-2) | |
(* Output of -dlambda *) | |
(setglobal Fib! | |
(letrec | |
(fib/1008 | |
(function n/1009 | |
(if (!= n/1009 0) | |
(if (!= n/1009 1) |
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 | |
((Fib/0 | |
(let* | |
((fib/1008 | |
(lambda (n/1009) | |
(if (not (equal n/1009 0)) | |
(if (not(equal n/1009 1)) | |
(+ (funcall fib/1008 (- n/1009 1)) (funcall fib/1008 (- n/1009 2))) | |
1) | |
0)))) |
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
[ { "score": 300, "name": "(Closed) Wahiro", | |
"address": "112 East Coast Road", | |
"geo": [ 1.30501126709, 103.905173164 ] }, | |
{ "score": 300, "name": "Yong Huat", "address": "125/127 East Coast Road", | |
"geo": [ 1.306044, 103.904794 ] }, | |
{ "score": 300, "name": "Puteri Mas (Joo Chiat)", | |
"address": "475A Joo Chiat Road", "geo": [ 1.3063423, 103.904712 ] }, | |
{ "score": 297, "name": "Coriander", "address": "220 East Coast Road", | |
"geo": [ 1.3073885145, 103.907421243 ] }, | |
{ "score": 294, "name": "Geylang Lor 29 Fried Hokkien Mee", |
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
open Spotlib.Spot | |
open GapiUtils.Infix | |
open GapiLens.Infix | |
open GapiLens.StateInfix | |
open GapiMonad.SessionM | |
module OAuth2 = GapiOAuth2 | |
module Conv = GapiConversation | |
module Service = GapiService |
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 Id = struct | |
let name = "pa_fun_fields" | |
let version = "1.0" | |
end | |
open Camlp4 | |
module Make (Syntax : Sig.Camlp4Syntax) = struct | |
include Syntax |
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
match x with | |
| OpeExp (e1, op, e2) -> | |
begin match op with | |
| Plus -> ... | |
| Minus -> ... | |
end | |
| Root (e1, e2) -> ... |
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
(** Generation of typerep methods for tag-checking *) | |
(* XXX simply moved to sig.ml ? *) | |
open Typerep_lib.Std | |
module Sig = struct | |
open Sig | |
type res = [%import: Sig.res] | |
and ftypekind = [%import: Sig.ftypekind] |
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
hahaha |
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 () = | |
ignore @@ GMain.Main.init (); | |
let window = GWindow.window ~width:100 ~height:100 () in | |
ignore @@ window#event#connect#configure ~callback:(fun ev -> | |
let open GdkEvent.Configure in | |
prerr_endline (Printf.sprintf "Configure %dx%d+%d+%d" | |
(width ev) | |
(height ev) | |
(x ev) | |
(y ev)); |