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
;; Packages required : | |
;; jujube-theme | |
;; haskell-mode | |
;; ghc | |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . | |
"http://marmalade-repo.org/packages/")) | |
(package-initialize) |
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 Control.Monad | |
import Control.Monad.Identity | |
import Control.Monad.Trans | |
import Control.Monad.Writer.Lazy | |
data Step | |
= Action String | |
| Assertion Bool String | |
deriving (Show, Eq) |