Poppen's Lab
This is Markdown editor.
| module Tree where | |
| data Tree a | |
| = Tip | |
| | Node (Tree a) a (Tree a) | |
| mirror :: Tree a -> Tree a | |
| mirror Tip = Tip | |
| mirror (Node l v r) = Node (mirror r) v (mirror l) |
| import Criterion.Main | |
| import Data.List | |
| f :: Int -> Int | |
| f n = foldl1' (+) $ zipWith (+) [1..n] [1..n] | |
| main = defaultMain | |
| [ bgroup "map" | |
| [ bench "map" $ whnf f 1000000 | |
| ] |
| {-# LANGUAGE BangPatterns #-} | |
| import Control.Monad | |
| import Control.Monad.ST | |
| import Control.Applicative | |
| import qualified Data.Vector.Unboxed as V | |
| import Data.Vector.Unboxed ((!)) | |
| import qualified Data.Vector.Algorithms.Intro as Intro | |
| isort v = runST $ do |
| import Control.Monad | |
| import Control.Monad.ST | |
| import Control.Applicative | |
| import Text.Printf | |
| import Data.Vector.Generic ((!)) | |
| import qualified Data.Vector as V | |
| import qualified Data.Vector.Unboxed as U | |
| main :: IO () | |
| main = do |
| fizzbuzz :: Int -> String | |
| fizzbuzz n = fromMaybe (show n) $ | |
| (guard (n `mod` 3 == 0) >> pure "Fizz") <> | |
| (guard (n `mod` 5 == 0) >> pure "Buzz") | |
| main :: IO () | |
| main = forM_ [1..100] $ putStrLn . fizzbuzz |
| import Control.Monad | |
| import Control.Monad.Trans | |
| import Control.Monad.Trans.Loop | |
| main :: IO () | |
| main = do | |
| putStrLn $ "Can you guess the number I have?" | |
| repeatLoopT $ do | |
| a <- liftIO $ readLn | |
| liftIO $ putStrLn $ "You said: " ++ show a |
| 大鳳: | |
| - 4000/2000/5000/7000:1 52.94% (27/51) | |
| - 7000/7000/7000/7000:1 46.88% (15/32) | |
| - 3500/3500/6000/6000:1 38.67% (29/75) | |
| - 7000/7000/7000/7000:20 32.08% (17/53) | |
| - 5000/3000/5000/7000:100 21.43% (12/56) | |
| - 7000/7000/7000/7000:100 20.19% (63/312) | |
| - 4000/2000/5000/5000:20 19.51% (8/41) | |
| - 4000/2000/5000/6000:100 18.37% (9/49) | |
| - 4000/2000/5000/5500:20 18.02% (51/283) |
| Monadic Effectシステムは計算のEffectを追跡する統一された方法を提供するが、 | |
| 計算がそれが実行される環境にどのように依存するかを追跡する統一された方法は提供しない。 | |
| これはモダンソフトウェアでは重要な問題になってきている。 | |
| どこで分散計算が走るのか、どのリソースを使うのか、 | |
| その他環境の提供するものをどのように使うのか。 | |
| 我々は例として三つのコンテクスト依存解析を考察した。 | |
| ・生存性解析 | |
| ・暗黙パラメータの使用(分散計算におけるリソース使用解析と似ている) | |
| ・データフロープログラムのキャッシュ要求の計算 |
スタートアップ企業 Silk が、Haskellを採用した理由。
http://engineering.silk.co/post/31920990633/why-we-use-haskell
As a newly started company, we have a lot of technical decisions to make. One of the important ones is the choice of a programming language. Since we’re building a web application, this goes for both the client (i.e. the web browser) and the server.
新しく始めた会社として、我々はたくさんの技術的決定を行わなければなりません。中でも重要なのは、プログラミング言語の選択です。我々はウェブアプリケーションを作っていたので、この選択がクライアント(Webブラウザなど)とサーバの両方で必要になります。
On the client, there wasn’t much discussion. Javascript is the only viable choice, unless you want to use Flash or similar plugin-based models. But on the server, we had more freedom. Popular choices for web applications are dynamically typed languages like Ruby, Python and PHP, and statically typed languages like Java and C#.