This is an old revision of the document!
Table of Contents
Background
I am going to update this wiki as I am learning Haskell, and reading your comments.
Difficulties? You are not allone.
Learning Haskell is still quite hard for me, and I need my own code knowing that the code really works, and under which conditions. This is may be the same for you.
The reasons for the difficulties in learning Haskell, may be:
- Before I started with Haskell, I was only used to imperative languages (Assembler, C, Pascal, Modula-2, C++, PHP, and more). The most, I was used to C++.
- The difference between the imperative paradigm and the functional paradigm is like the differnce between hockey and chess.
- Often, the code examples are not appropriate.
- ..or I am to stupid?
- Some of the available examples are outdated.
- Somtimes just incomplete.
- Sometimes incompatible with the current packages.
- Sometimes they contain confusing usless, warning generating statements.
- Example here: Confusing pop statement in LYAH
- Some of the available documentation is incomplete or inaccurate.
- See the comments in here
- Some information are only available on stackoverflow or reddit.
- If you place questions on stackoverflow, and don't know how to formulate the question from the very beginning then you are also risking your reputation, like here, again
About Jörg Brüggamnn
Understanding
I was may be a techie since I was a curious child. At an age of approximately 8 years, I assambled an electric DC Motor, and was amased that it worked. I was so keen on understanding.
This understanding is very deep and also related to other topics:
* Technology * Why is the world like this? * Why is the world at all? * How do computers work? * I have to know how a computer works. * I build my computer? * I need to program. * Assembler * Modula-2 * C * C++ * PHP * Java script * Java * Haskell * Scala * … * Spirit * How does the brain work? * Does psychology work? * Can someone change himself or herself? * Is there a god? * How do neuronal networks work? * I have to program a neronal network. * What is spirituality, at all? * What is Zen? * I have to practice Zen. * I practice Meditation, since November 2008. * What is enlightenment? * Why is the driven mind so reluctant to try this? * … * Beeing one society * How can people live together and accepting eachother as they are? * …
Understanding Haskell
Let's put this question on hold: How can people live together and accepting eachother as they are?
In the meantime, let's understand how Haskell works?
- Example:
- Output:
[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541]
The code above works without any warnings with ghc 8.10.4 and option -Wall.
To understand this code (7 lines of code) completely I have to understand the following:
- Packets
- Prelude
- Monads
do-notation- Type signatures
- Type defaulting
- Type classes
- Type constraints
- Lists
- List comprehension
- Function composition
And there is also
- design
- optimisation
- test
- proove its validity
- to estabish
) 1 The code above may not work with extrem large numbers. I do not know at which conditions the floor function would fail. My calculator says sqrt((1E16x1E16)-1) is 9.999.999.999.999.999,9999999999999999, but sqrt((1E17x1E17)-1) is (1E17)!
