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
[関数型言語のウソとホント](http://qiita.com/hiruberuto/items/810ecdff0c1674d1a74e) | |
に引き続き、 | |
[純粋関数型JavaScriptのつくりかた](http://qiita.com/hiruberuto/items/810ecdff0c1674d1a74e) | |
という、とても有意義な記事を @hiruberuto 氏が連発しておられます。 | |
この一連の記事を起点にして思うことをいくつか共有します。 | |
----- |
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
#事象の地平面(イベント・ホライズン) オブジェクト指向という情報のブラックホール、アンチパラダイムとしての純粋関数型HaskellモナドをUNIXの標準ストリームとconsole.logで読み解く | |
##UNIXの標準ストリーム | |
####物質世界(ハードウェア)と論理世界(ソフトウェア) | |
 | |
>[標準ストリーム(英: standard streams)](http://ja.wikipedia.org/wiki/%E6%A8%99%E6%BA%96%E3%82%B9%E3%83%88%E3%83%AA%E3%83%BC%E3%83%A0)は、UNIXおよびUnix系オペレーティングシステムや一部のプログラミング言語インタフェースにおいて、プログラムとその環境(通常は端末)を実行前から接続している入出力チャネルである。現在では3つの入出力があり、標準入力 (standard input)、標準出力 (standard output)、標準エラー出力 (standard error) と呼ばれている。かつては通信回線に対応する標準補助入出力 (stdaux)、帳票印字を出力する装置に対応する標準プリンタ出力 (stdprn)も用意されていた。 | |
>背景 |
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
純粋関数型言語の定義は論争があるらしいです。 | |
多くの人が純粋関数型言語は副作用がない、という文脈で語っています。 | |
ところが、よくよく調べてみると、その「副作用」というのがかなりトリッキーなワードで、彼ら自身がIO(入出力)と副作用の関係、さらに参照透過との関係があまりよくわかっていない感じで、原因と結果がはちゃめちゃな言葉遣いをしているのをみます。 | |
私が純粋関数型っていうのは遅延評価戦略が不可分だ、って書いていたら、 | |
副作用の排除(この言葉がどういう感じで彼らに使われているのかが未だよくわからない)が重要だ、いう文脈でJavaScriptを純粋関数化する!という優秀な人が現れ、JavaScriptにHaskellのIOモナドを実装してしまいました。 | |
そのコードを見ると、それはJavaScriptに遅延評価を実装する典型的なコードであり、挙動の説明も完全に遅延評価でFRPの話でした。 |
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
world = $('hello')(out); |
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
貴社益々御清栄のこととお慶び申し上げます。 | |
平素は格別の御高配を賜り誠にありがとうございます。 | |
さて、首記の件に付きまして以下に取り纏めご報告させて頂きたくよろしくお願い申し上げます。 | |
ほげほげふがふがふーばー | |
このたびは首記の件における不具合発生事故に起きまして関係者各位殿に多大なるご迷惑をお掛けした事を深くお詫び申し上げます。上記の様に取り纏め今後共ご安心して御利用頂くと共に納入済みの機器については速やかにご担当者様とお打合せさせて頂き、実施時期を決定後水平展開を行います。また、今後納入の機器については仕様書に特記事項として記載し製造・設計共に特段の注意を払い納入させて頂く所存で御座いますので何卒よろしくお願い申し上げます。 | |
Mail: |
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 Pin_Arrays:pin_array_2x05 (layer F.Cu) (tedit 55D82C17) | |
(descr "Double rangee de contacts 2 x 5 pins") | |
(tags CONN) | |
(fp_text reference P1 (at 0.635 -3.81) (layer F.SilkS) | |
(effects (font (size 1 1) (thickness 0.15))) | |
) | |
(fp_text value CONN_01X10 (at 0 -3.81) (layer F.SilkS) hide | |
(effects (font (size 1 1) (thickness 0.15))) | |
) | |
(fp_line (start -6.35 -2.54) (end 6.35 -2.54) (layer F.SilkS) (width 0.15)) |
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
#React 入門 2016 あるいは statelessさらにprop不要で関数型・宣言型的にコーディングする手法 | |
#React(0.14+), JavaScript(ES6)は変化が激しすぎるのでReact入門記事を全面改訂します | |
当ブログで昨年2015年4月にUPしたReact解説記事(2つ) | |
- [React (.js Facebook)解説 関数型プログラミングに目覚めた! IQ145の女子高生の先輩から受けた特訓5日間 サポート記事 静的HTML編](http://kenokabe-techwriting.blogspot.jp/2015/04/react-js-facebook-iq145-html.html) |
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
const isFunction = (m) => (typeof m === "function"); | |
const isHigherOrder = (f) => isFunction(f("foo")); | |
const compose = (f, g) => (x => g(f(x))); | |
const isMonad = (m) => !(typeof m.val === "undefined"); | |
const M = (m = []) => { | |
const f = m1 => { | |
const m1S = isMonad(m1) ? m1 : M(m1); | |
return !isFunction(m) | |
? M(m1S.val(m)) // a-f chain |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<html xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'> | |
<head> | |
<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/> | |
<b:if cond='data:blog.isMobile'> | |
<meta content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0' name='viewport'/> | |
<b:else/> | |
<meta content='width=1100' name='viewport'/> | |
</b:if> | |
<b:include data='blog' name='all-head-content'/> |
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
{ | |
const equalJSON = a => b => JSON.stringify(a) === JSON.stringify(b); | |
const logEq = a => b => { | |
const result = equalJSON(a)(b); | |
console.log(result); | |
return result; | |
}; | |