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
#/bin/bash | |
OCAML_DIRECTORY=${HOME}/.opt/ocaml/ocaml-4.04.2/ | |
OCAML_BYTERUN=${OCAML_DIRECTORY}/byterun/ocamlrun | |
OCAML_DUMPOBJ=${OCAML_DIRECTORY}/tools/dumpobj | |
if [ $# != 2 ]; then | |
echo "usage: $0 <input> <output>" 1>&2 | |
exit 0 | |
fi |
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
#/bin/bash | |
OCAML_DIRECTORY=${HOME}/.opt/ocaml/ocaml-4.04.2/ | |
OCAML_BYTERUN=${OCAML_DIRECTORY}/byterun/ocamlrun | |
OCAML_DUMPOBJ=${OCAML_DIRECTORY}/tools/dumpobj | |
if [ $# != 2 ]; then | |
echo "usage: $0 <input> <output>" 1>&2 | |
exit 0 | |
fi |
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 Eval_base = struct | |
let eval eval_rec = function | |
| `Int n -> n | |
| _ -> | |
failwith "unknown expression" | |
let show show_rec = function | |
| `Int n -> string_of_int n | |
| _ -> | |
failwith "unknown expression" |
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
namespace ExpressionProblem { | |
using System; | |
interface Exp<E> where E: Exp<E> { } | |
class Int<E>: Exp<E> where E: Exp<E> { | |
public int Value { get; set; } | |
} | |
class Add<E>: Exp<E> where E: Exp<E> { | |
public E Operand0 { get; set; } |
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 SYM_base = sig | |
type 'a repr | |
val lam: ('a repr -> 'b repr) -> ('a -> 'b) repr | |
val app: ('a -> 'b) repr -> 'a repr -> 'b repr | |
end | |
module type SYM_bool = sig | |
include SYM_base | |
val bool: bool -> bool repr | |
val not_: bool repr -> bool repr |
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
(* | |
* Copyright (c) 2017 Takahisa Watanabe <[email protected]> All rights reserved. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
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
(* | |
* Copyright (c) 2017 Takahisa Watanabe <[email protected]> All rights reserved. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
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
(* | |
* Extensible VariantsとClassによるOpen-Recursionを用いた拡張可能なインタプリタ | |
* [author] linerlock | |
* [update] 2017/05/18 | |
*) | |
module type SYNTAX = sig | |
type var | |
type tpe = .. | |
type exp = .. |
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
find . -name "*.ml" -exec emacs --batch {} --eval '(progn (indent-region (point-min) (point-max) nil) (save-buffer))' \; |
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 (_, _) eql = Refl : ('a, 'a) eql | |
type _ type_rep = .. | |
module type TYPEABLE = | |
sig | |
type t | |
val type_rep : unit -> t type_rep | |
val eqty : 's type_rep -> (t, 's) eql option | |
end |