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
(menhir | |
(modules parser)) | |
(ocamllex lexer) | |
(executable | |
(name main) | |
(modes js)) |
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
(menhir | |
(modules parser)) | |
(ocamllex lexer) | |
(executable | |
(name ex)) |
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
list : '[' elements ']'; | |
elements : element (',' element)*; | |
element : NAME | assign | list | list_assign; | |
assign : NAME '=' NAME; | |
list_assign : list '=' list; | |
NAME : ('a'..'z' | 'A'..'Z')+; |
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 D = Effect.Deep | |
type 'a expr = .. | |
type _ Effect.t += Extension : 'a expr -> 'a Effect.t | |
(* Base Interpreter *) | |
type 'a expr += | |
| Int : int -> int expr | |
| Add : int expr * int expr -> int expr | |
| Sub : int expr * int expr -> int expr |
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
(ns simple-compojure.core | |
(require | |
[ring.adapter.jetty :refer [run-jetty]] | |
[ring.middleware.params :as p] | |
[simple-compojure.middleware :as m] | |
[simple-compojure.routes :as r] | |
)) | |
(def app | |
(-> r/routes |
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 exp as e | |
import value as v | |
import globals | |
def _eval(exp, env): | |
match exp: | |
case e.Num(n): | |
return v.Num(n) | |
case e.Symbol(s): | |
return find(s, env) |
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
(ns simple-hiccup.core | |
(require | |
[ring.adapter.jetty :refer [run-jetty]] | |
[simple-hiccup.middleware :as m] | |
[simple-hiccup.routes :as r] | |
)) | |
(def app | |
(-> r/routes | |
m/logger |
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 Base = struct | |
type _ Effect.t += | |
| IsOdd: int -> bool Effect.t | |
| IsEven: int -> bool Effect.t | |
end | |
module Odd = struct | |
let is_odd n = | |
if n=0 then false | |
else Effect.perform (Base.IsEven (n-1)) |
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
list : '[' elements ']'; | |
elements : element (',' element)*; | |
element : ('a'..'z' | 'A'..'Z')+; |
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
list : '[' elements ']'; | |
elements : element (',' element)*; | |
element : NAME | assign | list; | |
assign : NAME '=' NAME; | |
NAME : ('a'..'z' | 'A'..'Z')+; |
NewerOlder