- make
IO.output
andIO.input
structural types - replace
Enum
byGen
(structural too) - split
IO
into its own subpackage - split
Unix
(and its interfaces toIO
) into a subpackage
- https://simon.cedeela.fr
- @[email protected]
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 ExtLib | |
(* sum of the ints in the list *) | |
let sum_list_seq l = | |
Sequence.fold (+) 0 (Sequence.of_list l) | |
(* sum of the ints in the list *) | |
let sum_list_enum l = | |
Enum.fold (+) 0 (List.enum l) |
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
Performance counter stats for './zipperposition.native -calculus delayed Problems/RNG/RNG007-5.p -progress -steps 2000': | |
32205,421073 task-clock # 0,994 CPUs utilized | |
6 278 context-switches # 0,195 K/sec | |
26 cpu-migrations # 0,001 K/sec | |
17 681 page-faults # 0,549 K/sec | |
114 089 153 802 cycles # 3,543 GHz | |
51 700 780 017 stalled-cycles-frontend # 45,32% frontend cycles idle | |
<not supported> stalled-cycles-backend | |
150 913 459 037 instructions # 1,32 insns per cycle |
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
class type ['a, 'b] index = | |
object | |
method name : string | |
method get : 'a -> 'b list | |
method add : 'a -> 'b -> ('a, 'b) index | |
method remove : 'a -> 'b -> ('a, 'b) index | |
method keys : ('a -> unit) -> unit |
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
(** {2 Universal type} *) | |
module Univ = struct | |
(** This is largely inspired by https://ocaml.janestreet.com/?q=node/18 . *) | |
type t = { | |
mutable id : unit ref; | |
mutable store : unit -> unit; | |
} (** The universal type *) | |
type 'a embedding = { |
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 'a ty = | |
| Int: int ty | |
| String: string ty | |
| List: 'a ty -> 'a list ty | |
| Pair: ('a ty * 'b ty) -> ('a * 'b) ty | |
| Record: ('a, 'a) record -> 'a ty | |
and (_, _) record = | |
| Build : 'b -> ('b, 'r) record | |
| Field : ('a -> 'builder, 'r) record * string * 'a ty * ('r -> 'a) -> ('builder, 'r) record |
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 rec take n l = | |
match n, l with | |
| 0, [] -> [] | |
| _, [] -> raise (Invalid_argument "plop") | |
| _, h::t when n < 0 -> raise (Invalid_argument "drop") | |
| 0, _::_ -> [] | |
| _, h::t -> h :: take (n - 1) t;; | |
take 2 [1; 2; 3; 4];; | |
take 2 [];; |
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 'a view = | |
| Var of string | |
| App of 'a * 'a list | |
| Lam of string * 'a | |
module T : sig | |
type t | |
val view : t -> t view | |
val var : string -> t | |
val app : t -> t list -> t |
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 'a hlist = | |
| HNil : unit hlist | |
| HCons : 'a * 'b hlist -> ('a * 'b) hlist | |
(** Description of type ['a] *) | |
type 'a ty = | |
| Int : int ty | |
| Bool : bool ty | |
| Sum : 's sum -> 's ty |
OlderNewer