タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

LLとFunctionalに関するyuguiのブックマーク (1)

  • template - 白のカピバラの逆極限 S.144-3

    Haskell はほとんど電卓代わりなのに、なぜか Haskeller にされている。好きな言語ですけれども、よく知らないのでストーカーのような。 それで、遅延評価のよいところを聞かれて、とりあえず、有名な fib を挙げる。 fib = 1: 1: (map (uncurry (+)) $ zip fib (tail fib))それに対して、C++template だと自動的にmemo化されるから高速だよね、という話が、でてくる。 #include<iostream> using namespace std; template<int n> class fib; template<> class fib<0>{ public: static const int x = 1; }; template<> class fib<1>{ public: static const int x

    template - 白のカピバラの逆極限 S.144-3
  • 1