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 Module | |
( secretNumber | |
) where | |
secretNumber :: Int | |
secretNumber = 4 |
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
cabal-version: 1.12 | |
name: demo | |
version: 0.9.0 | |
author: Tom Feron | |
maintainer: Tom Feron | |
build-type: Simple | |
library | |
hs-source-dirs: src | |
ghc-options: -Wall |
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
import _ from "underscore" | |
import game from "./sequentialActions.js" | |
function testInterpreter (program, inputs, accOutputs) { | |
switch (program.action) { | |
case "read": | |
const input = inputs[0] | |
const rest = inputs.slice(1) | |
return testInterpreter(program.next(input), rest, accOutputs) |
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
import readline from "readline-sync" | |
function read () { | |
return { | |
action: "read", | |
next: pure, | |
} | |
} | |
function print (string) { |
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
function numberField (key) { | |
return { | |
action: "numberField", | |
key, | |
} | |
} | |
function stringField (key) { | |
return { | |
action: "stringField", |
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
import readline from "readline-sync" | |
// Side effects | |
class EffectfulImplementation { | |
getUserInput () { | |
return readline.question("> ") | |
} | |
listTodoItems () { |
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
import parser from "./nonSequentialActions.js" | |
function generateDocumentation (parser) { | |
switch (parser.action) { | |
case "pure": | |
return null | |
case "stringField": | |
return { [parser.key]: "string" } |
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
CREATE TYPE _weighted_avg_fraction | |
AS (num double precision, denom double precision); | |
CREATE OR REPLACE FUNCTION _weighted_avg_step (acc _weighted_avg_fraction, | |
val anyelement, pond anyelement) RETURNS _weighted_avg_fraction AS $$ | |
BEGIN | |
RETURN (acc.num + val * pond, acc.denom + pond); | |
END; | |
$$ LANGUAGE plpgsql; |
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
Require Import Coq.Arith.Arith. | |
Section predicated_list. | |
Variable A : Type. | |
Variable bin_rel : A -> A -> Prop. | |
Hypothesis bin_rel_trans : forall a b c : A, bin_rel c b -> bin_rel b a -> bin_rel c a. | |
Set Implicit Arguments. |