You are not logged in.
fsckd wrote:Morn, haskell doesn't restrict things like that. Haskell is not "mathematical" anymore than C is.
This is actually not true, you can have type level restrictions that do not allow certain values, see: http://www.haskell.org/haskellwiki/Smar … ype_system
I was responding to the idea that haskell restricts a program from doing certain things which other languages do not. As you pointed out, it is perfectly possible to have those limits but the programmer has to be the one to add them. They are not forced restrictions one must work around.
I should have worded it better. Thanks for expounding it.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Nisstyre56 wrote:fsckd wrote:Morn, haskell doesn't restrict things like that. Haskell is not "mathematical" anymore than C is.
This is actually not true, you can have type level restrictions that do not allow certain values, see: http://www.haskell.org/haskellwiki/Smar … ype_system
I was responding to the idea that haskell restricts a program from doing certain things which other languages do not. As you pointed out, it is perfectly possible to have those limits but the programmer has to be the one to add them. They are not forced restrictions one must work around.
I should have worded it better. Thanks for expounding it.
Point taken. Anyway, I don't think what he said would be a problem were it true, because you would know right away that an error is going to occur (Assuming you were using dependent types), that's the magic of dependently typed languages. To elaborate, assuming the "Oh we might want some bad data to creep in because it will eventually work itself out" model, you would know that you had a problem when you try to compile the program, so you can easily just extend your types to include that "bad" data. You still get the benefits of knowing exactly what kind of values will be passed to your functions at runtime (and you get the speed benefits from not needing dynamic checks).
In Zen they say: If something is boring after two minutes, try it for four. If still boring, try it for eight, sixteen, thirty-two, and so on. Eventually one discovers that it's not boring at all but very interesting.
~ John Cage
Offline
fsckd wrote:Morn, haskell doesn't restrict things like that. Haskell is not "mathematical" anymore than C is.
This is actually not true, you can have type level restrictions that do not allow certain values, see: http://www.haskell.org/haskellwiki/Smar … ype_system
Thanks for clearing that up, Nisstyre!
If Haskell were really "not any more mathematical than C", then its popularity with mathematicians would be very hard to explain IMO. Constraints on allowed input and output values for functions are commonplace in mathematics, so that feature had to exist in Haskell somewhere.
Offline