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
| -- test1.hs | |
| -- No dead code: compiles to 1.22M executable | |
| -- with stripped .o 1320 byes | |
| -- .o file md5sum: 35ccd1647c772a5757fba3ae8bfa6542 | |
| main :: IO () | |
| main = getLine >>= print | |
| -- test2.hs | |
| -- With dead code: compiles to 1.22M executable |
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
| #!/bin/bash | |
| SHAKEFILE=${1:-"Shakefile"} | |
| if [ ! -e "$SHAKEFILE" ]; then | |
| tee -a "$SHAKEFILE" << 'EOF' > /dev/null | |
| import Development.Shake | |
| opts = shakeOptions { shakeFiles = ".shake/" |
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.Maybe (isJust) | |
| assert :: Bool -> Maybe () | |
| assert True = Just () | |
| assert False = Nothing | |
| checkAssertions :: Maybe () -> Bool | |
| checkAssertions = isJust | |
| checkMatch :: Person -> Person -> Bool |
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 FlexibleContexts #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeSynonymInstances #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE EmptyDataDecls #-} | |
| {-# LANGUAGE OverloadedStrings #-} |
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 System.Random | |
| import Control.Monad.Random | |
| import Control.Monad | |
| metroStep :: (RandomGen g) => (Double -> Double) -> Double -> Double -> Rand g Double | |
| metroStep p step x = do | |
| dx <- getRandomR (-step, step) | |
| let | |
| newx = x + dx | |
| p0 = p x |
NewerOlder