I hereby claim:
- I am bracevac on github.
- I am betareduction (https://keybase.io/betareduction) on keybase.
- I have a public key ASBRKqoNHBG3FV5ZgTujzO6w66ChYbU2nlVfr-5leJ1Ppwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import scala.language.higherKinds | |
//Module signatures become traits/interfaces | |
trait Symantics { | |
type Ctx[A] | |
type Var[A] | |
type Repr[A] | |
type Shape[A] | |
def from[A](shape: Repr[Shape[A]]): Var[Repr[A]] |
type _ trep = .. | |
type _ trep += | |
| TInt: int trep | |
| TString: string trep | |
| TFloat: float trep | |
| TList: 'a trep -> 'a list trep | |
| TFun: ('a trep * 'b trep) -> ('a -> 'b) trep | |
(* Emulating type classes *) | |
module ShowClass = struct |
(* Encoding tagless interpreters with effects and handlers. | |
TODOs: | |
- do more examples from the tagless papers, especially with phantom types | |
- examples of "higher order transformations", e.g., index-based definitions and index conversions | |
*) | |
module NumAlg = struct | |
(* New symantics instances should extend this. Having this GADT makes it not | |
truly "tagless". However, many other advantages of the final tagless style | |
carry over still. Perhaps one could try to improve the theory of effect handlers/handling |
(** * General support for creation of dynamic effects *) | |
(** We show how to use the multicore Ocaml effects to dynamically generate local | |
effects. Such effects are akin to the Eff resources, and they can be used to | |
implement ML references. | |
The code is based on "Eff directly in OCaml" by Oleg Kiselyov and KC | |
Sivaramakrishnan (http://kcsrk.info/papers/caml-eff17.pdf). It was written by | |
Andrej Bauer, Oleg Kiselyov, and Stephen Dolan at the Dagstuhl seminar | |
"Algebraic Effect Handlers go Mainstream". *) |
module Segfault = struct | |
module Nondet = struct | |
effect Fork : bool | |
let fork () = perform Fork | |
let rec forkEach f = function | |
| [] -> () | |
| x::xs -> | |
(* if branches are swapped, then no segfault occurs *) |
I hereby claim:
To claim this, I am signing this object: