Skip to content

Instantly share code, notes, and snippets.

View 23Skidoo's full-sized avatar

Mikhail Glushenkov 23Skidoo

View GitHub Profile
@23Skidoo
23Skidoo / HaddockListBug.hs
Last active August 29, 2015 14:04
Haddock list rendering bug
-- | The first list is incorrectly numbered as 1. 2. 1.; the second example
-- renders fine (1. 2. 3.).
--
-- See https://github.com/haskell/haddock/issues/313
module HaddockListBug
where
{- |
Some text.
@23Skidoo
23Skidoo / Test2035.hs
Created August 18, 2014 21:35
Test for Cabal bug #2035
-- See https://github.com/haskell/cabal/issues/2035
module Main
where
import qualified Data.ByteString.Lazy.Char8 as L
import Control.Monad
import Data.Functor
import Data.Maybe
import Network.Browser
@23Skidoo
23Skidoo / log.txt
Created October 1, 2014 22:14
ag -l '^build-depends'
ad/0.40/ad.cabal
ad/1.0.0/ad.cabal
ad/1.0.1/ad.cabal
ad/0.33.0/ad.cabal
ad/0.40.1/ad.cabal
ad/0.44.0/ad.cabal
ad/0.44.1/ad.cabal
ad/0.44.2/ad.cabal
ad/0.44.3/ad.cabal
ad/0.44.4/ad.cabal
@23Skidoo
23Skidoo / test.c
Created October 30, 2014 02:19
MEM_RESERVE gobs of memory on Windows happens instantly.
/* See https://ghc.haskell.org/trac/ghc/ticket/9706 */
#include <windows.h>
#include <stdio.h>
int main() {
printf("How many GB to reserve:");
SIZE_T numGB = 1;
scanf("%Iu", &numGB);
SIZE_T toReserve = numGB*1024*1024*1024;
@23Skidoo
23Skidoo / meta02_VNM.10.0.7.10_9.log
Created April 19, 2011 07:55
[meta02_VNM.10.0.7.10_9.log] FAIL
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
@23Skidoo
23Skidoo / Main.hs
Created May 4, 2011 22:33
Data.Map.lookup without Maybe
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
@23Skidoo
23Skidoo / myZcat.hs
Created May 7, 2011 15:34
zcat with iterIO
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
@23Skidoo
23Skidoo / Trace.hs
Created May 8, 2011 11:06
Modified sequencing monad
-- 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
@23Skidoo
23Skidoo / SomeStruct.hs
Created May 19, 2011 18:51
Experiments with unboxed mutable records
module Main
where
import Control.Monad
import Data.IORef
data SomeStruct = SomeStruct { someField :: {-# UNPACK #-} !Int,
someOtherField :: {-# UNPACK #-} !Int,
yetAnotherField :: {-# UNPACK #-} !Float }
@23Skidoo
23Skidoo / GSoC.hs
Created May 20, 2011 07:14
GSoC project prototype
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