Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Resources for Functional Programming?

by tsee (Curate)
on Mar 17, 2004 at 10:22 UTC ( [id://337274]=note: print w/replies, xml ) Need Help??


in reply to Resources for Functional Programming?

I learned Haskell in my first semestre at university and it was a very interesting new perspective on programming. I'll wholeheartedly recommend Haskell as the most "pure" functional language I know and thus the one you'd probably want to learn first.

However, because of this "pureness", some common tasks are made awfully awkward. Best example are probably IO routines which, by definition, are not free of side-effects because the side-effect (here: the disk operater or whatever) is the operations whole purpose. Since that doesn't fit in the concept of purely functional languages, the purists couldn't sleep well. But they were clever purists and decided that hence forth, such operations were to be called monads, which, as the documentation told me, are some obscure mathematical functions that may have side-effects. I'll refrain from posting example code since that'd become really off topic.

On the positive side is that Haskell has a graphics library and both interpreters and compilers for ease of debugging or speed. It's easy to read once you got the hang of it, too. I suggest you start with Haskell.

Steffen

Replies are listed 'Best First'.
Re: Re: Resources for Functional Programming?
by halley (Prior) on Mar 17, 2004 at 14:13 UTC
    Not having any experience in Haskell, but having tried Prolog a few times in the 80s and 90s, I remember the pain of doing things that fell outside the "declarative" realm.

    For example, just about everything that had to do with a user interface. Printing text is a "side effect" (or in your Haskell terminology, probably seen as a monad). Asking a user a question. Responding to the user's input.

    The big problem in Prolog with such constructions was that Prolog's whole view of the world was that you could search a database of rules and backtrack as necessary. But with monadic tasks, you really don't want any backtracking. You don't want to pop up a dialog on the user's screen, wait for an answer, and then backtrack (possibly trying a different dialog box) when you realize that the user's answer didn't get your program any closer to a "solution."

    --
    [ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://337274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-29 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found