タグ

2014年2月18日のブックマーク (5件)

  • Making Sense of GHC Error Messages: Part 1

    Haskell compiler errors can at first seem obtuse but, once you get to know them, are in fact very descriptive and helpful, sometimes much more so than in other build environments! In this series I’m going to pick apart the most common error messages, that baffled me at first coming from a C++ background, and hopefully it will save you some of the time that I had to spend, digging through the Haske

    Making Sense of GHC Error Messages: Part 1
  • こつこつアルゴリズム(Spigot Algorithm)

    概要 円周率の値を計算するためには、多倍長計算をしなければならないと思われていました。ところが、こつこつアルゴリズムを用いると、特別に多倍長計算をしなくてもよいことが示されました。 最初に、こつこつアルゴリズムの概要について示します。このアルゴリズムでは、次の級数を基にして計算します。 ここで、divを整数商、modを剰余としますと、(例えば、となります) が成り立ちます。こつこつアルゴリズムでこの関係をどう用いるか、最初にネイピア数を例に、示すことにします。まず、小数点以下1桁目の1を抽出します。式中の青色の部分にご注目ください。 これで、7が抽出できました。引き続き、小数点以下2桁目の1を抽出してみます。 この手続きを繰り返すことにより、多倍長計算をせずに小数点以下の数を求めることができるわけです。実際には、繰り上がりの処理等をしなければなりませんが、質はここで述べた計算にあります。

  • Reddit - Dive into anything

    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...

    nfunato
    nfunato 2014/02/18
  • 型安全なリストに対する補足とGADTsの話ですー>ω<

    お久しぶりですー>ω< 気がついたら一ヶ月も経っていてしまいました(´・ω・`) 前回の記事で実際に動かすことの出来ないtailを公開してしまったので、この記事はその謝罪と説明と補足になります(`・ω・´) 前回の記事で問題だったところ(・ω・? 問題だったのは、具体的にはここですm9(・∀・)ビシッ!! このtailは残念なことに型エラーが出て動かないのです(´・ω・`) なぜなのでしょうか?? 出てきたエラーメッセージを見てみます>< SafeList_by_PhantomType.hs: Couldn't match type `y' with `x' `y' is a rigid type variable bound by a pattern with constructor Cons :: forall x a y. a -> SafeList y a -> SafeList

    nfunato
    nfunato 2014/02/18
  • The Typed Racket Guide

    Sam Tobin-Hochstadt <samth@racket-lang.org>, Vincent St-Amour <stamourv@racket-lang.org>, Eric Dobson <endobson@racket-lang.org>, and Asumu Takikawa <asumu@racket-lang.org> Typed Racket is Racket’s gradually-typed sister language which allows the incremental addition of statically-checked type annotations. This guide is intended for programmers familiar with Racket. For an introduction to Racket,