Skip to content

Instantly share code, notes, and snippets.

@Shimuuar
Shimuuar / magick.hs
Created August 28, 2012 18:02 — forked from qnikst/magick.hs
Do magik
import Data.Default
import Debug.Trace
data Proxy a = Proxy
class Magick a where
magickStorage :: Proxy [a] -> String
instance Magick Int where
magickStorage = const "Int"
@Shimuuar
Shimuuar / Prime.hs
Created March 16, 2012 13:26 — forked from max630/MainCLI.hs
testing prime speed
{-# LANGUAGE NoMonomorphismRestriction, BangPatterns #-}
module Main where
-- compile: ghc --make -main-is Prime.main Prime.hs -O2
-- $time ./Prime i 500000
-- ./Prime i 500000 4.35s user 0.00s system 99% cpu 4.453 total
-- ./Prime s 500000 7.69s user 0.03s system 99% cpu 7.726 total (!!!)
-- lookup OPT in comments about various optimization points
import System.Environment(getArgs)