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 S = sig type t val e : t end;; | |
module type S = sig type t val e : t end | |
# let f () = (module struct type t = int let e = 14 end : S);; | |
val f : unit -> (module S) = <fun> | |
# let module M = (val f () : S) in M.e;; | |
Characters 33-36: | |
let module M = (val f () : S) in M.e;; | |
^^^ | |
Error: This expression has type M.t but an expression was expected of type | |
M.t |
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 t = () of int;; | |
type t = () of int | |
# module F () = struct end;; | |
module F : functor () -> sig 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
# type t = :: of int;; | |
type t = :: of int | |
# :: 1;; | |
Characters 0-2: | |
:: 1;; | |
^^ | |
Error: Syntax error | |
# 1 :: ;; | |
Characters 5-7: | |
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
S asmcomp | |
S asmrun | |
S bytecomp | |
S byterun | |
S driver | |
S parsing | |
S stdlib | |
S tools | |
S typing | |
S utils |
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
camlArr__access_1008: | |
.cfi_startproc | |
subq $8, %rsp | |
.cfi_adjust_cfa_offset 8 | |
.L101: | |
movq %rax, %rdi | |
movq -8(%rdi), %rax | |
movq %rax, %rsi | |
shrq $9, %rsi | |
cmpq %rbx, %rsi |
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 S = sig | |
type t | |
val id : t -> t | |
val f : t -> t | |
val g : (t -> t) -> t -> t | |
end | |
module F(A:S) = struct | |
type t = A.t | |
let f x = A.id (A.g A.f (A.id x)) |
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
(* | |
問題はbexpに対してEq (Equal)とLe (LessEqual)を定義して、 | |
bval (Eq a b) s = (aval a s = aval b s) と | |
bval (Le a b) s = (aval a s <= aval b s) | |
を証明せよというものです。 | |
*) | |
theory Ex3_7 | |
imports Main | |
begin |
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 Core_bench | |
exception Ex1 | |
exception Ex2 | |
let ( ** ) n m = | |
let rec mul cnt = | |
if cnt = 0 then 1 else n * mul (cnt - 1) in | |
mul m |
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
/* fはloop1の内部でループしてる関数 */ | |
camlExept2__f_1464: | |
.cfi_startproc | |
.L104: | |
/* クロージャの環境から定数を持ってきて */ | |
movq 16(%rbx), %rdi | |
/* 比較 */ | |
cmpq %rdi, %rax | |
/* 比較結果のフラグで分岐 */ | |
jne .L103 |
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
(* ocamljava -o caml.jar -runtime-parameter runtime-lock=off -I +concurrent -I +javalib javalib.cmja -java-extensions concurrent.cmja unix.cmja ./testjava.ml *) | |
open JavaPervasives | |
let size = 1000000 | |
let a = Array.make size 100 | |
let rec tarai x y z = | |
if x <= y then y |