二端子対回路網の模式図 二端子対回路(にたんしついかいろ、two-terminal pair network, two ports、四端子回路とも)は、入力端子対と出力端子対の2組の端子からなる電気回路またはデバイス。 例えばトランジスタ、フィルタ回路などがある。2端子対回路の分析は1920年代にドイツ人の数学者Franz Breisigによって研究が始められた。 概要[編集] 二端子対回路 二端子対回路は、入力と出力の電圧と電流の関係を調べるため、入力と出力の間にある回路を分離し、特有のパラメータで示すことが基本となる。このパラメータが決まると、入力と出力の間にある回路の細部を考える必要が無くなり、一つの特殊な特性を持った暗箱(ブラックボックス)にでき、回路の分析を単純化できる。暗箱に独立した出力端子がなければどんな回路もパラメータで表せ、二端子対回路に変形できる。 二端子対回路で入力と
Two weeks ago, I briefly introduced a way of representing Assembly Language in Haskell code, in order to illustrate the programming paradigm to which it belongs. In a move that is sure to scare off both high-level and low-level programmers, I shall now explain how a Monad implementing 6502 Assembly can be created. In real code, this would use more abstract or efficient types, but in this article I
Published on June 11, 2014 This article starts a series in which I am going to publish my thoughts on and experience with different «extensible effects» approaches. This one in particular will explain the problem with the classic mtl approach that motivates us to explore extensible effects in the first place. How transformer stacks are born Often we start with a single monad — perhaps Reader or St
日本語でArrowの説明があまり見付からなかったので、Haskell/Understanding arrows - Wikibooks, open books for an open worldを読んで理解したつもりのメモ。オリジナルの図を見ながらだと分かりやすいかも。誤り・間違いなど、乞うご指摘。 b->cな関数をArrowなるからくり箱に入れると、 (Arrow a) => a b c こんな型になる。型パラメタが、引数のbと返値のcのふたつ。 Monadは、値をからくり箱に入れたもの。からくり箱は基本的に(ヘンな)値。 Arrowは、関数をからくり箱に入れたもの。からくり箱は基本的に(ヘンな)関数。 arr :: (b -> c) -> a b c Monadでは、値をからくり箱に入れる関数returnがある。 Arrowでは、関数をからくり箱に入れる関数arrがある。 (>>>)
While playing around with querying ElasticSearch I bumped into something that I hadn't really understood explicitly before about monads, nesting, and IO. Rather than blather on, I'm going to share a "literate" ghci session that demonstrates the point. Main editing change I made was to remove duplication in the output from querying the type :t in ghci. import Network.HTTP import Control.Monad (join
UPDATE (2014/03/01) It turns out that there was a better way to do this, please see this new post. Rationale I am currently experimenting with the operational package. This post provides a rough outline on how I moved from an IO based monad stack to an isomorphic pure representation of the computation. I am unfortunately not well endowed on the theoretical side, so this will be a very practical po
The Haskell programming language community. Daily news and info about all things Haskell related: practical stuff, theory, types, libraries, jobs, patches, releases, events and conferences and more...
Friday, February 21, 2014 Logging flow activity Foreword Everyone needs to log things in a program. Have you already wondered what kind of logs you were dealing with? I don’t mean debug, warning or error logs. I mean semantic here. Basically, I’ll put apart two concepts: tracing an algorithm’s behavior tracing a flow activity Tracing an algorithm’s behavior is something we often do in Haskell with
状態をモナドで実現する方法を考えます。 リスト 例は簡単な方がいいので、データ構造として Lisp 風のリストを定義しましょう。 data List a = Nil | Cons a (List a) deriving Show リストは、こんな風に表せます。 Cons "c" (Cons "b" (Cons "a" Nil)) Lisp 風の cons も定義してみましょう。 cons :: a -> List a -> List a cons x xs = Cons x xs cons "c" $ cons "b" $ cons "a" Nil → Cons "c" (Cons "b" (Cons "a" Nil)) 状態を持つリスト さて、この Lisp 風のリストに、要素の数を覚えさせておきたいとしましょう。もちろん、数えれば分りますが、数えなくても一瞬で分るようにしたいのです。
前フリ 最近@seizansさんが新人Haskell使いを増やしまくっている。 で、その人達がググった時のために先にたくさんブログ記事書いて釣ろうぜっていう話をしていたけど、@kazu_yamamotoさんとか@nom4476さんらが仰るように、一旦自分がわかってしまうとなかなか記事を書く気力が起きない(し、子育てで忙しいので後は任せたって言われた)。 そうこうしているうちに@seizansさんがすごい勢いでHaskell力を伸ばしはじめた。 なので最近彼が覚えたらしいモナドトランスフォーマーの入門的な記事をStateモナドと合わせて先回りして書いてしまおうというわけす。引用数を稼ぐには先手必勝です。 Stateモナド Haskellで一時的な状態を持たせたい時はStateモナドを使うらしいですよ。 といっても何が何だかよくわかんないんですけど、 状態モナド遊び - あどけない話 この記事
私の感覚としては、モナドはかなりわかりづらい。モナドの定義とか計算法則はわりとわかる。以下サイトがおすすめ。 Haskell の State モナド (1) - 状態を模倣する | すぐに忘れる脳みそのためのメモ: http://jutememo.blogspot.jp/2009/10/haskell-state-1.html しかし実際にプログラムを書いてみると、使い方がわからない。特に IO モナドがわからない。実際にプログラムを書いて困った点、それらをどのように解決しているか? ということをまとめる。 今から振り返ると Real World Haskell の内容ちゃんと理解して読んでたら問題にすらならなかったんですけどね。 1. 副作用の分離? モナドは副作用のある計算を分離するなど言われる。確かに多くのモナドでは純粋な関数からモナドを使用し、run することにより値を取り出すこと
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く