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 split_by = Str.regexp "," | |
let read_line chan = | |
match input_line chan with | |
| c -> Some c | |
| exception End_of_file -> None | |
let rec fold_channel f acc chan = | |
match read_line chan with | |
| Some line -> fold_channel f (f line acc) chan |
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
import qualified Data.Map as M | |
type State = String | |
type Symbol = (String, Int) | |
data TreeAutomaton = TreeAutomaton | |
{ symbols :: [Symbol] | |
, states :: [State] | |
, finalStates :: [State] | |
, delta :: M.Map (Symbol, [State]) State |
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 Core_kernel.Std | |
type colour = Red | Green | Magenta | Yellow | Blue | Black | White | Cyan | |
let shuffle l = | |
List.map ~f:(fun c -> (Random.bits (), c)) l | |
|> List.sort ~cmp:compare | |
|> List.map ~f:snd | |
let all = [Red; Green; Magenta; Yellow; Blue; Black; White; Cyan] |
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 Safe = struct | |
module Util : sig | |
type t = Yojson.Safe.json | |
val member : string -> t -> t | |
end = struct | |
let rec find_key name = function | |
| [] -> 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
let () = | |
let sleep, wake = Lwt.wait () in | |
let ti = Lwt_timeout.create 2 (fun () -> | |
print_endline "oh hai"; | |
Lwt.wakeup_later wake ()) in | |
Lwt_timeout.start ti; | |
Lwt_main.run sleep |
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
File "src/slacko.ml", line 1: | |
Error: The implementation src/slacko.ml | |
does not match the interface src/slacko.cmi: | |
Values do not match: | |
val groups_rename : | |
string -> | |
group -> | |
string -> | |
[> `Account_inactive | |
| `Channel_not_found |
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
Program received signal SIGSEGV, Segmentation fault. | |
do_lookup_x (undef_name=undef_name@entry=0x4037c2 "__deregister_frame", new_hash=new_hash@entry=2068692891, | |
old_hash=old_hash@entry=0x7fffffffda00, ref=0x4022a0, result=result@entry=0x7fffffffda10, scope=0x7fff00000000, i=0, | |
version=0x7ffff7fd98d0, flags=1, skip=0x0, type_class=1, undef_map=0x7ffff7ffe148) at dl-lookup.c:353 | |
353 size_t n = scope->r_nlist; | |
(gdb) bt | |
#0 do_lookup_x (undef_name=undef_name@entry=0x4037c2 "__deregister_frame", new_hash=new_hash@entry=2068692891, | |
old_hash=old_hash@entry=0x7fffffffda00, ref=0x4022a0, result=result@entry=0x7fffffffda10, scope=0x7fff00000000, i=0, | |
version=0x7ffff7fd98d0, flags=1, skip=0x0, type_class=1, undef_map=0x7ffff7ffe148) at dl-lookup.c:353 | |
#1 0x00007ffff7de57e8 in _dl_lookup_symbol_x (undef_name=0x4037c2 "__deregister_frame", undef_map=0x7ffff7ffe148, ref=0x7fffffffdac8, |
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
ocamlfind c -I /home/marek/llvm36/lib/ocaml -cclib -L/home/marek/lib -cc g++ -ccopt -Wno-write-strings llvm_target.cma llvm_executionengine.cma -safe-string -warn-error +a -g -I src/global -I src/scanparse -I src/simplify -I src/typecheck -I src/normalize -I src/optimize -I src/codegen -package menhirLib -package ctypes.foreign -bin-annot unix.cma str.cma menhirLib.cmo llvm.cma llvm_bitreader.cma llvm_bitwriter.cma -o bin/stellarunit src/stellarunit.cmo | |
File "_none_", line 1: | |
Error: Error while linking /home/marek/llvm36/lib/ocaml/llvm_executionengine.cma(Llvm_executionengine): | |
Reference to undefined global `Ctypes' |
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 query uri return_value_fn = | |
let%lwt (_, body) = Cohttp_unix.Client.get uri in | |
let%lwt content = Cohttp_body.to_string body in | |
Yojson.Basic.from_string content | |
|> validate | |
|> filter_useless | |
|> return_value_fn | |
|> Lwt.return | |
let flip f x y = f y 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
module type I = sig | |
type t | |
val id: t -> t | |
end | |
module Integers = struct | |
type t = int | |
let id x = x | |
end |