This file contains hidden or 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
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" |
This file contains hidden or 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
{-# 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) |