This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Interesting call: 145; interesting frame number: 2 | |
Interesting call: 20; interesting frame number: 1 | |
Interesting call: 66; interesting frame number: 0 | |
Interesting call: 241; interesting frame number: 0 | |
Interesting call: 241; interesting frame number: 2 | |
Interesting call: 66; interesting frame number: 0 | |
Interesting call: 295; interesting frame number: 0 | |
Interesting call: 382; interesting frame number: 2 | |
Interesting call: 347; interesting frame number: 0 | |
Interesting call: 310; interesting frame number: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
where | |
import Control.Exception | |
import Data.Map as M | |
import Data.Maybe | |
-- Well, since you don't have any constraints on the type of the input argument, | |
-- you can't be absolutely sure that your function will be always used | |
-- correctly. I too would use an assertion here (or change my function to return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
where | |
import Control.Monad.IO.Class (MonadIO) | |
import Data.ByteString.Lazy (ByteString) | |
import Data.IterIO | |
import Data.IterIO.Zlib (inumGunzip) | |
import System.Environment | |
import System.IO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- See | |
-- http://stackoverflow.com/questions/5920200/how-to-prevent-common-sub-expression-elimination-cse-with-ghc | |
module Main | |
where | |
import Debug.Trace | |
data Eval a = Done a | |
| Trace String a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
where | |
import Control.Monad | |
import Data.IORef | |
data SomeStruct = SomeStruct { someField :: {-# UNPACK #-} !Int, | |
someOtherField :: {-# UNPACK #-} !Int, | |
yetAnotherField :: {-# UNPACK #-} !Float } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
where | |
import Control.Concurrent | |
import Control.Monad | |
import Data.Map((!)) | |
import qualified Data.Map as M | |
import System.Environment(getArgs) | |
-- The program consists of several threads which communicate via Chans. There |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
where | |
-- See "Do We Need Dependent Types?" by Fridlender & Indrika | |
-- http://www.brics.dk/RS/01/10/ | |
(<<) :: [a -> b] -> [a] -> [b] | |
(f:fs) << (a:as) = f a : (fs << as) | |
_ << _ = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://stackoverflow.com/questions/6411771/nested-triangular-loop-in-haskell/6413934 | |
Java version: | |
0.06072334190603272 | |
2.590520221772998 | |
5.098582403887274 | |
7.59983261470893 | |
10.096589520693144 | |
12.588688490747979 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
where | |
-- See http://stackoverflow.com/questions/6411771/nested-triangular-loop-in-haskell | |
import Control.DeepSeq | |
import Criterion.Main | |
import Data.Array | |
import Data.List (tails) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- See http://stackoverflow.com/questions/6439925/poor-performance-lockup-with-stm | |
{-# LANGUAGE BangPatterns #-} | |
module Main where | |
import Control.Concurrent.STM | |
import Control.Concurrent | |
import System.Random(randomRIO) | |
import Control.Monad(forever, when) |
OlderNewer