Skip to content

Instantly share code, notes, and snippets.

{
base64ToBuffer: base64 => new TextEncoder().encode(atob(base64)),
bufferToBase64: buffer => btoa(String.fromCharCode(...new Uint8Array(buffer)))
}
const nums$ = fromEvent(document, "click").pipe(
mapTo(((x: number) => x + 1)),
scan((acc, whatever) => acc, 0)
);
/*
Argument of type 'MonoTypeOperatorFunction<number>' is not assignable to parameter of type 'OperatorFunction<(x: number) => number, number>'.
Types of parameters 'source' and 'source' are incompatible.
Type 'Observable<(x: number) => number>' is not assignable to type 'Observable<number>'.
Type '(x: number) => number' is not assignable to type 'number'.
{
"type": "package",
"name": "ccapndave/elm-tree-path",
"summary": "Strongly typed fixed level trees with a zipper.",
"license": "BSD-3-Clause",
"version": "1.0.0",
"exposed-modules": [
"TreePath.Data",
"TreePath.Tree2",
"TreePath.Tree3",
port module WebSocket exposing (listen, send, open)
open : String -> Cmd msg
open url =
wsOpen { url = url }
send : String -> String -> Cmd msg
send url message =
module type SelectData = {
type t;
let id: t => string;
let toString: t => string;
};
module Styles = {
open Css;
let search = style([width(px(300)), fontSize(px(20))]);
module type GridInterface = {
type t('a);
let make: (~xNames: list(string), ~yNames: list(string)) => t('a);
let xNames: t('a) => list(string);
let yNames: t('a) => list(string);
let get: (t('a), ~x: int, ~y: int) => option('a);
/* let set: (t('a), ~x: int, ~y: int, ~value: 'a) => t('a); */
};
module Grid: GridInterface = {
module Grid = {
module type Grid = {type t;};
type t = {
rowNames: list(string),
columnNames: list(string),
data: array(array(string)),
};
let make = (~rowNames, ~columnNames): t => {
module TreePath.Tree4
exposing
( DecoderConfig
, Tree
, TreePath1
, TreePath2
, TreePath3
, TreePath4
, data1
, data2
type NodeId
= NodeMenuId
| NodeCourseId String
| NodeUnitId String
| NodeExerciseId String
nodeIdDecoder : Decoder NodeId
nodeIdDecoder =
JD.string |> JD.andThen (\nodeStr ->
module Tree4 exposing (..)
import Array exposing (Array)
import Data exposing (Data)
type Tree4 a b c leaf =
Tree4
{ data : Data a leaf
, children : Array (Tree3 b c leaf)
}