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
| class Utils { | |
| static unsnoc(array) { | |
| return { | |
| init: array.slice(0, -1), | |
| last: array[array.length - 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
| module type Eq = sig | |
| type t | |
| val equal : t -> t -> bool | |
| end | |
| module type Order = sig | |
| type comparison = | |
| | Less | |
| | Equal |
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
| {-# language TupleSections #-} | |
| import Control.Arrow ((&&&)) | |
| import Data.Function (on) | |
| import Data.List (groupBy, sortBy) | |
| import Data.Ord (comparing) | |
| f :: Ord k => [(v, [(k, x)])] -> [(k, [(v, x)])] | |
| f = map (fst.head &&& map snd) -- [[(k, (v, x))]] -> [(k, [(v, x)])] |
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
| @code-color: hsl(0,0%,100%); | |
| @keyword-color: hsl(0,0%,70%); | |
| @string-color: hsl(80,55%,55%); | |
| @comment-color: hsl(0,0%,0%); | |
| @syntax-background-color: hsl(0,0%,24%); | |
| @syntax-cursor-color: hsl(0,0%,100%); | |
| @syntax-selection-color: hsl(0,0%,30%); | |
| @syntax-selection-flash-color: hsl(210,100%,100%); |
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
| var StdLib = require('./stdlib.js') | |
| /* | |
| module for working with input streams (char iterators, in fact) | |
| */ | |
| var Stream = require('./stream.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
| var M = ( | |
| { set: (o, ...things) => Object.assign({}, o, ...things) | |
| , copy: (o) => M.set(o) | |
| , modify: (o, diff) => | |
| { var result = M.copy(o) | |
| for (var key in o) | |
| if (diff[key]) |
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
| var ok = (value, offset) => ({good: true, value, offset}) | |
| var err = (message, offset) => ({message, offset}) | |
| var pure = (value) => ({type: "pure", value}) | |
| var fail = (message) => ({type: "fail", message}) | |
| var token = (token) => ({type: "token", token}) | |
| var any = (...parsers) => ({type: "any", parsers}) | |
| var many = (parser) => ({type: "many", parser}) | |
| var some = (parser) => ({type: "some", parser}) |
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 Data.Map (Map) | |
| import qualified Data.Map as Map | |
| import Data.Composition | |
| import Data.Monoid | |
| data Type | |
| = Type :$ Type | |
| | TVar Name |
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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <script src="./classy-frp.js"> | |
| </script> | |
| <script> | |
| var digits = Event.new(); | |
| var dots = Event.new(); | |
| var ops = Event.new(); | |
| var enters = Event.new(); |
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 Html exposing (text) | |
| import String exposing (join) | |
| -- Entry point | |
| main = text <| toString <| test | |
| -- Test data | |
| testState = {cells = |