learn_haskell/00_preamble.lhs

39 lines
1.9 KiB
Text
Raw Normal View History

2012-02-09 16:25:00 +00:00
begindiv(intro)
2012-02-24 15:57:19 +00:00
This article should be named: "Blow your mind with Haskell".
2012-02-07 17:37:36 +00:00
2012-02-24 15:57:19 +00:00
As many people it was hard for me to bend my mind to the Haskell language.
In this article I give some ressource to help pass some wall of incomprehension.
2012-02-07 17:37:36 +00:00
2012-02-24 15:57:19 +00:00
First, in order to make things work I deliever a as short as possible list of boring syntax notation used by Haskell.
2012-02-07 17:37:36 +00:00
2012-02-24 15:57:19 +00:00
Once you understand the notation, we could reach the real stuff. The one that make Haskell both unique and hard to learn.
2012-02-07 17:37:36 +00:00
2012-02-24 15:57:19 +00:00
First, what you _shouldn't_ expect from Haskell?
From my experience:
2012-02-07 17:37:36 +00:00
2012-02-24 15:57:19 +00:00
- _Terseness_. Haskell can be extremely terse, but some language are better at this game, for example codegolf, ruby and python.
- _Readability_. Many might say it is a question of habit, but personally I find Haskell harder to read than Python and Ruby. It is not necessarily a drawback. Haskell code can be compared to a scientific paper. You have some very readable part, but sometimes you can encounter a mathematical formula. In these case, you need to focus because something hard is happening.
2012-02-07 17:37:36 +00:00
2012-02-24 15:57:19 +00:00
What to expect then?
2012-02-14 10:24:17 +00:00
2012-02-24 15:57:19 +00:00
An excelent balance between speed and high level.
Haskell is very fast even if not as fast as C but it has an incredible ability to make your code generalizable.
In fact the only limit of generalization of your code are either your intellectual capacity or some mathematical properties.
Guess which limit is generally reached first?
This actual article contains three parts.
- Introduction: a fast dig inside some real Haskell example
- Basic Haskell: Haskell syntax, and some essential notions
- Haskell Walls: Explaining the hard parts; IO and Monads
> Note: Each time you'll see a separator with a filename ending in `.lhs`, you could click the filename to get this file. If you save the file as `filename.lhs`, you can run it with
> <pre>
> runhaskell filename.lhs
> </pre>
>
2012-02-24 16:31:00 +00:00
> You should see a link just below the line.
2012-02-09 16:25:00 +00:00
enddiv