Created
April 1, 2017 06:10
-
-
Save relrod/17d928ffb2838c31a23288a007b8df22 to your computer and use it in GitHub Desktop.
Simpler(-ish) GHC bug reproducer
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.AffineSpace | |
import Data.Thyme.Clock | |
import Data.Thyme.Time | |
filterTimes | |
:: [UTCTime] | |
-> UTCTime | |
-> NominalDiffTime | |
-> [UTCTime] | |
filterTimes ts u d = | |
let x t = abs (t .-. u) - realToFrac d < 0 | |
in mfilter x ts | |
main :: IO () | |
main = do | |
let t = mkUTCTime (fromGregorian 2017 03 29) 21700 | |
entries = [t] | |
aBitLater = mkUTCTime (fromGregorian 2017 03 29) 21750 | |
diff = 150 | |
print $ filterTimes entries aBitLater diff |
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
#!/usr/bin/env bash | |
function echoAndRun { | |
echo "$1" | |
$1 | |
} | |
echoAndRun "rm *.o *.hi" | |
echoAndRun "ghc -Wall --make -O0 repro.hs" | |
echoAndRun "./repro" | |
echoAndRun "rm *.o *.hi" | |
echoAndRun "ghc -Wall --make -O repro.hs" | |
echoAndRun "./repro" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment