タグ

2011年8月29日のブックマーク (2件)

  • UAX #11: East Asian Width

    Summary This annex presents the specifications of a normative property for Unicode characters that is useful when interoperating with East Asian Legacy character sets. Status This document has been reviewed by Unicode members and other interested parties, and has been approved for publication by the Unicode Consortium. This is a stable document and may be used as reference material or cited as a n

  • Haskellの文法(再帰編) - あどけない話

    構造化定理によれば、分岐、反復、逐次があれば、すべてのロジックは記述できます。分岐については、Haskellの文法(分岐編)で説明しました。今日は反復について説明します。逐次に関しては、少し難しい内容ですが、QAで学ぶMonadを読んで下さい。 for 文 多くの言語では、素朴な繰り返しを実現するためには for 文や while 文を使います。for文を単純に数え上げとして使う場合、カウンターである変数 i が再代入できるとことが前提になっています。 Haskell では、変数に再代入はできません。それは、for 文がないことを意味します。どうやって、繰り返しを実現するのでしょうか? その答えは、再帰です。 対比するための言語として JavaScript を用いることにします。まず、以下のように渡された整数の配列の要素をすべて足し合わせるプログラムを考えて下さい。 function su

    Haskellの文法(再帰編) - あどけない話