Fight the Future

Java言語とJVM、そしてJavaエコシステム全般にまつわること

モナドについて調べていく(7)

One Div Zero: Monads are Elephants Part 1(モナドは象だ)というエントリがあったので、これを訳してモナドの学習を進めます。


Introductions to monads are bit of cottage industry on the Internet.

モナドの紹介はインターネットでのほんの小さな事業です。


So I figured, "why buck tradition?"

なので私は「なぜ慣習を破るのか?」と思うのです。


But this article will present Scala's way of dealing with monads.

しかし、この記事ではScalaモナドを扱う方法を示します。


An ancient parable goes that several blind men were experiencing their first elephant.

一昔前の寓話があります。盲目の男たちがいました。彼らは象をしったばかりでした。


"It's a tree," one said while wrapping his arms around its legs.

1人は「あれば大木だ」と両足を腕で包みながら言いました。


"A large snake," another said while holding its trunk.

もう1人は「あれば大蛇だ」と胸を包みながら言いました。


A third said...um, something about a broom or a fan or whatever.

3人目の男は「うーん」と言いながら、ほうきか扇か何かを想像しました。


From this parable we can conclude this: the ancients believed that the visually impaired like to fondle large mammals.

この寓話の結論はこうです。古人は次のように信じていました。
視覚障害を持つ人たちは大型の哺乳動物を愛でるのだと。


Fortunately we live in a more enlightened age.

幸運にも我々はより賢明な時代に生きています。


We're also supposed to learn something about how our limitations can prevent us from grasping the whole picture and that we're all blind in some way. It's so Zen.

我々もまた自分たちの制約がどれほど全体像をつかむことを妨げているかということ、そして我々もある意味みな盲目であることを学ぶべきです。
それはまさに禅のようです。


I think there's a third lesson to be learned - the opposite of the main intent: that it's possible to learn much about the big picture by getting a series of limited explanations.

私は思います。これは学ぶべき3度目のレッスンだと。主な意図とは正反対だけれども。
限られた一連の説明から全体像をより学べるかもしれません。


If you had never seen an elephant and people told you things like "it has legs as thick as tree trunks," "a nose like a snake," "a tail like a broom," "ears like fans," etc. then you'd soon have a pretty good understanding.

もし象を一度も見たことがなく、「大木の幹のような足を持っている」「蛇のような鼻だ」「鼻のような尻尾だ」「扇のような耳だ」などのように考えるように人々が伝えれば、すぐにとてもよい理解が得られるでしょう。


Your conception wouldn't be perfect, but when you finally saw an elephant it would fit neatly into the mental picture you had slowly built up.

概念は完璧ではないでしょうが、象をやっと見たとき、ゆっくり築いていた想像の姿ときちんとフィットさせられるでしょう。


Just as the elephant was about to step on you, you'd think "wow, the legs really are like trees."

まさに象が歩いてきたら「おお。本当に木のような足だ」と思うでしょう。


続きます。