Why does my Haskell assertion only happen in IHaskell?
If I define import Control.Exception (assert) import Data.Char (ord) f :: String -> String f s = assert (all (`elem` letters) s) $ (letters!!) <$> (ix <$> s) where ix ch = (ord ch - ord 'A') letters = ['A'..'Z'] then if I execute f "AB.CD" in IHaskell, I get :10:7-12: Assertion failed as I would expect. But in all other settings, the assertion seems to be ignored. For example in GHCi (7.10.2) I get ghci>f "AB.CD" "AB*** Exception: Prelude.!!: negative index and if I put the expression in a program main :: IO () main = do print $ f "AB.CD" I get prgm: Prelude.!!: negative index "AB Why is my