- Download Instant Client:
- instantclient-basic-macos.x64-11.2.0.4.0.zip
- instantclient-sdk-macos.x64-11.2.0.4.0.zip
- instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
-
Unzip and move to /opt
-
Create symlink
| // Example code, see below for run/yield implementation. Note how we | |
| // can even do yields across the stack, so this implements something | |
| // more like coroutines than generators. | |
| function foo() { | |
| var x = Yield(); | |
| return x + 1; | |
| } | |
| var process = Run(function() { |
| // Example code, see try/catch/throw implementation below | |
| function bar(x) { | |
| if(x < 0) { | |
| Throw(new Error("error!")); | |
| } | |
| return x * 2; | |
| } | |
| function foo(x) { |
| object STRef { | |
| /** | |
| * Here is a container where we have a single "state thread" = ST. | |
| * When we run this thread of type ST[T] we get a result of type T. | |
| */ | |
| sealed abstract class ST[+T] { | |
| def map[R](fn: T => R): ST[R] = flatMap(t => Const(fn(t))) | |
| def flatMap[R](fn: T => ST[R]): ST[R] = FlatMapped(this, fn) | |
| } |
| type zero = unit | |
| type 'a succ = unit -> 'a | |
| type one = zero succ | |
| type 'a plus_1 = 'a succ | |
| type 'a plus_2 = 'a plus_1 plus_1 | |
| type 'a plus_4 = 'a plus_2 plus_2 | |
| type 'a plus_8 = 'a plus_4 plus_4 |
| import Svg (Svg, circle, svg, g, line, text) | |
| import Svg.Attributes (cx, cy, r, fill, stroke, strokeWidth, x, y, x1, x2, y1, y2, fontSize, style) | |
| import Html | |
| import Html.Attributes as Html | |
| import Signal (Signal, map, foldp) | |
| import DragAndDrop (mouseEvents, MouseEvent(..)) | |
| import List | |
| -------------- |
Unzip and move to /opt
Create symlink
| signature TYPEINFER = | |
| sig | |
| type tvar = int | |
| datatype monotype = TBool | |
| | TArr of monotype * monotype | |
| | TVar of tvar | |
| datatype polytype = PolyType of int list * monotype | |
| datatype exp = True | |
| | False | |
| | Var of int |
| import static java.lang.System.*; | |
| import java.util.function.BiFunction; | |
| import java.util.function.Function; | |
| // Implementation of a pseudo-GADT in Java, translating the examples from | |
| // http://www.cs.ox.ac.uk/ralf.hinze/publications/With.pdf | |
| // The technique presented below is, in fact, just an encoding of a normal Algebraic Data Type | |
| // using a variation of the visitor pattern + the application of the Yoneda lemma to make it | |
| // isomorphic to the targeted 'GADT'. |
| module queue | |
| import Data.Vect | |
| -- Here's the port of the Liquid Haskell blog post on amortized | |
| -- queues. The tricksy bit is that the "amortized" bit depends on | |
| -- laziness. This means that while in the REPL (where Idris is lazy) | |
| -- this is reasonably efficient. It compiles absolutely horribly | |
| -- though because each time push or pop something we rotate the whole | |
| -- damned thing. |
| console.log("\033[39mRunning tests…"); | |
| function assertEquals(actual, expected, description) { | |
| if(typeof(actual) === "undefined") { | |
| console.error("\033[31m" + description + " not implemented\033[39m"); | |
| } else { | |
| if(actual !== expected) { | |
| console.error("\033[31m" + description + " failed, expected " + expected + ", got " + actual + "\033[39m"); | |
| } else { | |
| console.log(description + " \033[32m ok\033[39m"); | |
| } |