Vimeo Events Produce and promote stunning virtual events and webinars. Get started
Vimeo Events Produce and promote stunning virtual events and webinars. Get started
require 'egison' include Egison match_all(object) do with(pattern) do ... end end match(object) do with(pattern) do ... end with(pattern) do ... end ... end パターンマッチに成功すると、withに渡されたブロックが実行され、その結果が返されます。 このライブラリのパターンマッチでは、パターンマッチの結果が複数あるということがあります。 match_all構文はそのすべてのパターンマッチの結果それぞれについてwithに渡されたブロックを実行し、すべての結果をまとめた配列を返します。 match_all構文は1つのwith節を取ります。 一方、matchは複数のwith節を取ります。 先頭のwith節のパターンから順番にパターンマッチに成功
前回はFRPのBehaviorとEventという重要な概念と、Haskellでの代表的なライブラリを簡単に紹介しました。今回は紹介したものの中からreactiveというライブラリを取り上げます。 なお、reactiveを理解するにあたってLess Sugar/More Meat » Blog Archive » Introducing Reactive: Eventsというチュートリアルがとても役に立ったことを書いておきます。この後出てくる解説も冒頭部分はこのチュートリアルからとってきています。それと、動作環境はLinux上のGHC 6.12.1でコンパイルしたreactive 0.11.4を使っています。 reactiveの特徴 reactiveはConal Elliottが作った最新のFRPライブラリで、ライブラリのユーザ側から見た大きな特徴は、Arrowを使わない古典的FRPをFun
関数型LT大会で「実社会の問題を解決する関数型言語」というタイトルで発表しました。 というのも、会社で「すごいHaskellたのしく学ぼう!」の輪読会をしていて、最初こそ10人以上の人が参加していたのだけど、章が進むごとにどんどん人が離脱していって、主催者としてはなんとか完走したいという思いがあったので、調べたのですが、 ヒアリングから、この二つの線がクロスしたときに、人は離脱するという知見が得られました。 ということで、Haskellに対して実用性を見出したいと思いながら半年を過ごしたのですが、実用的 = 仕事で使うということであれば、今の現場でHaskellに移行するのは現実的ではありません。 でも、Haskellには関数型言語のエッセンスが詰まっていて学びが多かったと思っていて、直接的には使っていないけど、概念として役立つことがあると思ったので、それを伝えるために今回文章に起こしまし
CλaSH : CAES Language for Synchronous HardwareIntroduction CλaSH (pronounced ‘clash’) is a functional hardware description language that borrows both its syntax and semantics from the functional programming language Haskell. The merits of using a functional language to describe hardware comes from the fact that combinational circuits can be directly modeled as mathematical functions and that funct
Functional Reactive Programming (FRP) integrates time flow and compositional events into functional programming. This provides an elegant way to express computation in domains such as interactive animations, robotics, computer vision, user interfaces, and simulation. Introduction The original formulation of Functional Reactive Programming can be found in the ICFP 97 paper Functional Reactive Anima
注意: このエントリは書きかけです。 前回はHaskellのFRPライブラリのreactiveについて取り上げ、Eventの使い方を紹介しました。今回はFRPにおいてEventと並んで重要なBehaviorを見ていきます。 Behaviorとは Behaviorについては前回触れましたが、再度おさらいしておきます。Behavior とEvent の意味は、それぞれ次のように与えられます。 Behaviorは時間の関数です。つまり時間とともに変化する値を表現できます。Behaviorの最大の特徴はそれが連続的な時間を扱えることです。Eventは特定の時間とそのときの値をペアにしたものなので、扱う時間は離散的ですが、Behaviorは任意の時間の値が得られます。連続的な時間を扱うことでプログラムがシンプルになります。このメリットについてはConal Elliott » Blog Archive
近年、関数型プログラミングの重要性はいろんなところで叫ばれています。 Javaの最新バージョンに関数型プログラミングに関する新機能が加わりました。 Rubyも昨今、関数型プログラミングへのサポートが手厚くなってきています。 プログラミングの教科書の大手、オライリー社から、Javascriptで関数型プログラミングを行うための解説書が発行されました。 関数型プログラミングへの注目度は高まってきています。 おそらく、みなさんは既にオブジェクト指向が何か、を知っています。 でも関数型プログラミングとは何か、胸を張って語れる人は、周りに見当たらないかと思います。 実際、オブジェクト指向によってプログラミングする方法は、わかりやすい解説があちこちにある一方で、 関数型プログラミングとは何か、何が良いのか、ということについての、よいまとめは見つけることはできませんでした。 この記事を読む方の中で、「関
Austin Seipp austin at well-typed.com Wed Apr 9 14:10:34 UTC 2014 Previous message: [Haskell] Call for papers: The 20th IEEE Pacific Rim International Symposium on Dependable Computing (PRDC 2014) Next message: [Haskell] ANNOUNCE: GHC version 7.8.1 Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] ============================================================== The (Interactive) Glasgow
http://www.well-typed.com/blog/90/ foldlに関するこの記事(英文)が面白かったので、勝手翻訳しました。 foldlなんとかなるといいですね。 foldlを直す foldl 関数は壊れている。壊れているとみんなが知っている。 四半世紀近く壊れたままだ。ついにこれを修正する時が来た! 今日、私はPrelude.foldlをData.List.foldl'として知られる実装で再定義することを提案する。 foldlは壊れている! 既にご存知だとは思うが、念のため… Haskellerが必ずfoldlではなく、foldrやfoldl'を使うように勧めてくることにお気づきだろうか? 例えばReal World Haskellでは次のように言っている。 `foldl`のサンクの挙動のため、実アプリではこの関数を使わないようにするのが望ましい。 特に問題がない場合でも
Sustainable Security Requirements with the ASVS Josh Grossman provides a brief overview of what the ASVS is, but takes a closer look at balancing trade-offs and prioritizing different security requirements. Josh shares how to make the process repeatable and how to implement it as part of your own organization's requirements process.
Many people bemoan the sharp divide between experts and beginning Haskell programmers. One thing I've noticed is that "advanced" Haskell topics all have one thing in common: there exists only one good tutorial on that topic and only the experts have found it. This post is a collection of links to what I consider to be the definitive tutorials on these topics. Monads Monads are technically not an a
Quicksort in Haskell Quicksort is a commonly used example of how succinct Haskell programming can be. It usually looks something likes this: qsort :: (Ord a Bool) => [a] -> [a] qsort [] = [] qsort (x:xs) = qsort (filter (<= x) xs) ++ [x] ++ qsort (filter (> x) xs) The problem with this function is that it's not really Quicksort. Viewed through sufficently blurry glasses (or high abstraction altitu
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く