On Thu, Mar 26, 2009 at 6:42 PM, Alexander Dunlap <alexander.dunlap@gmail.com> wrote:
On Thu, Mar 26, 2009 at 5:23 PM, wren ng thornton <wren@freegeek.org> wrote:Ultimately, it's not detectable statically, is it? Consider
> It's a static error, detectable statically, and yet it's deferred to the
> runtime. I'd much rather the compiler catch my errors than needing to create
> an extensive debugging suite and running it after compilation. Is this not
> the promise of purity?
import Control.Applicative
main = do
f <- lines <$> readFile "foobar"
print (head (head f))
You can't know whether or not head will crash until runtime.