Re:Confession of a Haskell Hacker
by GregBuchholz on Sunday July 08, 2012 @04:21PM
(#4215575)
For certain definitions of correct...
[ Parent
| on HN ]
Re:Confession of a Haskell Hacker
by applicative on Sunday July 08, 2012 @04:36PM
(#4215619)
Note the "Safety Inferred" seal of approval on the upper right hand corner of the hackage package http://hackage.haskell.org/packages/archive/lens-family-core... This means it survives a recursive check of dependencies that precludes that kind of nonsense.
Re:Confession of a Haskell Hacker
by DanWaterworth on Sunday July 08, 2012 @05:09PM
(#4215723)
I hadn't thought of that. Types serve as a good safety net, but they're not foolproof. Expecting something like that to be correct because it passed through the type checker is like expecting to be served at a restaurant dressed in a gorilla suit because you got through the door.
Re:Confession of a Haskell Hacker
by GregBuchholz on Sunday July 08, 2012 @05:28PM
(#4215788)
And of course it is fun to think about total functions that are "effectively" bottom...
id :: a -> a
id a = case (a,ack 4 3) of
(x,0) -> x
(x,_) -> x
where
ack 0 n = n+1
ack m 0 = ack (m-1) 1
ack m n = ack (m-1) (ack m (n-1))