You are not logged in.

#26 2012-11-08 12:55:00

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,552

Re: So you learned functional programming. Any regrets?

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. smile


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#27 2012-11-08 14:16:48

Nisstyre56
Member
From: Canada
Registered: 2010-03-25
Posts: 82

Re: So you learned functional programming. Any regrets?

fsckd wrote:
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. smile

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

#28 2012-11-09 23:26:13

Morn
Member
Registered: 2012-09-02
Posts: 346

Re: So you learned functional programming. Any regrets?

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

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

Board footer

Powered by FluxBB