4 ms·
I studied Haskell in college (with the Gofer variant), and it was GREAT for learning practical functional programming. We didn't use monads though (they weren'
by TuringTest 9y ago
I studied Haskell in college (with the Gofer variant), and it was GREAT for learning practical functional programming.
We didn't use monads though (they weren't in widespread use back then), so we had to learn the accumulator-parameter pattern and tail recursion the hard way.
Learning my foldr's and foldl's and zipwith's gave me confidence that almost any imperative programming can be equally represented as a recursive function, which is an important lesson for someone who had only learned about traditional imperative programming and OOP up to that point.
Of course, a proper course should center around algorithms and recursive data structures where functional programming shines; it should not begin with building business application logic, for which a classic language may have a gentler ramp-up.
- HelloNurse 9y agoIf your course didn't cover monads, it was a very introductory one which would have probably benefited from choosing a nicer and simpler language, like antiquated LISP or maybe Scheme.
- deleted 9y ago[deleted]
- TuringTest 9y agoIt was introductory, yes, although it also covered relational programming in PROLOG. I benefited from the type inference/type declarations, and learning about generics explained in a non-duck-typing way, though, which I wouldn't have had in LISP.
- wwweston 9y agoHey, can you point to or do you have any of the relational/Prolog programming materials? I dabbled in this years ago, mostly experimenting on my own, would love to see some materials designed for guided exploration.
- TuringTest 9y agoI'm afraid the material is some handwritten notes in Spanish, interleaved with some code examples in PROLOG. They were quite systematic IIRC, covering basic logic, data structures, proper use of the !bang for performance, etc. I no longer have the exercises in code, just paper. I've yet to scan my handwritten notes and bring them to the digital era :-) This may prompt me to finally do it. If you still want them, I can send you the scanned pdf to your mail. However, I think you'd better off with some free online course. On a cursory examination, this one seems similar to the content in my notes: [1] http://www.learnprolognow.org/lpnpage.php?pageid=online http://www.learnprolognow.org/lpnpage.php?pageid=online
- reddit_clone 9y ago> antiquated LISP That's debatable. True, Lisp is Old. Hardly antiquated.
- HelloNurse 9y agoI agree, but over the decades LISP developed significant complications, such as object oriented features; I think the most appropriate LISP for an introductory FP course would be a very antiquated and very simple and pure one, without advanced features (and the accompanying syntactic pollution) that might be of interest as advanced theory, useful in advanced practice, but a source of confusion and a major waste of time for beginners. Fancy LISP variants would still be vastly easier to learn than Haskell, but a straightforward computer adaptation of lambda calculus would minimize the distance between theory and running programs. I'm not familiar enough with Scheme or Clojure to tell whether they are too complex for an introductory course.
- flavio81 9y ago>I agree, but over the decades LISP developed significant complications, such as object oriented features How can this be a complication? On Common Lisp, you can just choose not to use object oriented features (the CLOS system). There are many CL libraries that do not use OOP code at all. And if you want to use them, in CLOS a method is called exactly the same as a function; they are called "generic functions", so the syntax is just the same. >without advanced features (and the accompanying syntactic pollution) I don't think there is any syntactic pollution. Again, in Common Lisp the syntax is totally uniform for all the features, in fact for a beginners' Functional Programming course, he/she would only need to learn: () parentheses for opening and closing an s-expression ; for comments ' for quoting an s-expression so it is not evaluated #' for indicating that the following symbol is a function name (not needed on Lisp-1 languages like Scheme) "" for delimiting a string ... and that's it!! "Advanced" features don't introduce too much syntax either: ` for quoting an s-expression in a "template" way (i.e. for use in macros) , for escaping the ` operator ,@ for escaping the ` operator, "splicing" the contents of a list; for example when passing a code block to a macro. For a language that is really extensive in features, the amount of syntax introduced is minimal, really. Compare with Haskell.
- DonaldFisk 9y ago> antiquated LISP By that do you mean "Lisp, which is antiquated", or "a LISP which is antiquated"? Lisp certainly isn't antiquated, but as the second oldest high level language after FORTRAN, there are antiquated versions of it (e.g. LISP 1.5).
- Chattered 9y agoWadler's introductory Haskell course at Edinburgh doesn't cover monads, but it's great. I don't want to use scheme because I want students exposed to a decent static type system. There's an argument to be made for using standard ml, maybe. I think the fact that strings are linked lists is great for beginners. One of their assignments is on web scraping, where they can reuse all their list based functions to solve the problem. I am not too keen on Haskell's polymorphism for teaching beginners, and error messages are mostly useless for them. If I were teaching again, I would be recommending custom preludes with simpler types.
- krfsm 9y agoThere were courses using haskell before monads were the smash hit they are now. In particular haskell didn't have monadic IO then. On the other hand, variants such as gofer were pretty simple.
- deleted 9y ago[deleted]