Re:“Mostly functional” programming does not work
by GregBuchholz on Sunday April 27, 2014 @10:42AM
(#7655241)
>For instance, in Haskell a value is a value. If I have a value of type Integer then it definitely exists;
[ Parent
| on HN ]
Re:“Mostly functional” programming does not work
by dllthomas on Sunday April 27, 2014 @11:31AM
(#7655444)
That's an important point, but since you can't test for undefined-ness it's not quite the same thing as carrying around something that's actually a Maybe Int but just hopes you'll check before implicitly using fromJust everywhere.
Re:“Mostly functional” programming does not work
by GregBuchholz on Sunday April 27, 2014 @02:00PM
(#7656045)
We just don't want to forget that exceptions and termination are effects, and that Haskell isn't perfectly pure...
a,b::Integer
a = div 1 0
b = sum [1..]
Re:“Mostly functional” programming does not work
by dllthomas on Sunday April 27, 2014 @02:56PM
(#7656261)
Certainly the case.
Re:“Mostly functional” programming does not work
by Dewie on Sunday April 27, 2014 @03:17PM
(#7656356)
If you want to avoid partial functions, I guess you would use Safe Haskell.
Re:“Mostly functional” programming does not work
by dllthomas on Sunday April 27, 2014 @03:35PM
(#7656461)
AFAIK, Safe Haskell doesn't do that. Am I missing something?
Re:“Mostly functional” programming does not work
by Dewie on Monday April 28, 2014 @01:37AM
(#7658365)
You're probably right. I can't find any mention of enforcing total functions.