Gistを使い始めて気がついた点をメモした。 Gistはこのようなメモや短いコードをバージョン管理しながら公開するのに便利。
特にこのメモでは、画像を同一ディレクトリに置いて、 それGFMファイル内に挿入する方法を解説。
このメモにはgitコマンドの使い方の解説はない。 このメモは随時更新される予定。
const I = x => x | |
const K = x => y => x | |
const A = f => x => f (x) | |
const T = x => f => f (x) | |
const W = f => x => f (x) (x) | |
const C = f => y => x => f (x) (y) | |
const B = f => g => x => f (g (x)) | |
const S = f => g => x => f (x) (g (x)) | |
const S_ = f => g => x => f (g (x)) (x) | |
const S2 = f => g => h => x => f (g (x)) (h (x)) |
//#!/usr/bin/env node --harmony | |
/*jshint esversion: 6 */ | |
'use strict'; | |
// Church numerals in ES6. | |
// c.f. https://en.wikipedia.org/wiki/Church_encoding | |
// Zero is the identity function. | |
let zero = (f => x => x); |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script type="module"> | |
import { h, text, app } from "https://unpkg.com/hyperapp" | |
app({ | |
init: () => 0, | |
view: state => | |
h("main", {}, [ |
export function flatMap<T, U>(array: T[], callbackfn: (value: T, index: number, array: T[]) => U[]): U[] { | |
return Array.prototype.concat(...array.map(callbackfn)); | |
} |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
import Control.Applicative (liftA2) | |
import Data.Char | |
import Data.Foldable (for_) | |
import Data.Functor | |
import qualified Data.HashMap.Strict as M | |
import Data.List (intercalate) | |
import Prelude hiding (any) |