Re: [Haskell-cafe] Why functional programming matters
Yaakov Nemoy wrote:
I'm still very much a newbie, but the one thing that struck me as the best feature coming from Python is the static typing. Changing the type of a function in Python will lead to strange runtime errors that take some work to debug, whereas, when I tinker with a program in Haskell, I already know it will work once it compiles.
I'm quite new to Haskell as well and I must echo this sentiment. The mainstream has somewhat realized that its a waste of time to tell the compiler the type of _everything_. Learning Haskell has completely reversed my feeling that static typing is an old outdated idea. The power of Haskell's type system makes it feel like you are programming in a dynamic language to some degree, yet all of it is type-checked, and that is just *really* cool. Honestly, when I first started reading a Haskell tutorial I was convinced that it was an runtime-typed language like Python. When the tutorial moved on to explain that it is statically typed I could barely believe it. The second thing I might want to highlight is the power of monads and other techniques like arrows and FRP. Granted, these are not easy concepts to impart in a talk, but I think they were really an important discovery in FP as they deal with the "problem" of IO in such a beautifully orthogonal way. Following on that, more advanced structures like arrows and how all of this can contribute to really powerful DSLs I think is a pretty big selling point. Actually, come to think of it, one great way to show off the language is to show off the power of some of the libraries that have been written. For example, show how easily a parser can be created w/ Parsec; or show an example of FRP w/ Yampa. These examples will likely tantalize the programmers in the audience to want to learn more. Good luck! /mike.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Actually, come to think of it, one great way to show off the language is to show off the power of some of the libraries that have been written. For example, show how easily a parser can be created w/ Parsec; [...]
yes, Parsec is amazing. I use it in my e-Learning/testing system. It uses Parsec to read (student) input from a text entry area in a CGI application. http://www.imn.htwk-leipzig.de/~waldmann/autotool/ Parsec shows the benefits of embedding a DSL into Haskell: it gives you full combinatorial power: in types (e.g. lists of parser) and functions (e.g. from parser to parser), and all that with full safety. best regards, Johannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHmesc3ZnXZuOVyMIRAl2vAJ0VViyJe4tcxFiVpMR0suO50Bez5wCeIwi+ BK4GC4cqv5K25lT2k7B80zY= =jz0r -----END PGP SIGNATURE-----
participants (2)
-
Johannes Waldmann -
Michael Reid