In my household, functors, applicatives and monads have been bad words for some time.
I have since worked out that pushing me to Write a Scheme Interpreter in 48 Hours was to get me to learn more about monads.
I'm struggling a little with understanding the bind operator and how it works. I'm somewhat familiar with do notation, but I am not quite there yet with the IO monad either.
I am currently reading Learn You A Haskell's section on monads as well as working through a handful of basic exercises from How to Design Programs to familiarise myself with Scheme and it's syntax.
This thing is going to take me much more than 48 hours. :P
Showing posts with label Learn You A Haskell for a Great Good. Show all posts
Showing posts with label Learn You A Haskell for a Great Good. Show all posts
Sunday, 28 December 2014
Tuesday, 19 August 2014
Data.List
I'm reading through Learn You a Haskell's section on Data.List at the moment, and fiddling around with rewriting some of the functions.
Some are harder than others.
For instance, I used to think that at the end of the list, there were infinite : [] : [] : [] and so you go because if xs in (x : xs) could be infinite, why not : []?
Things I try to do for each of the functions I'm rewriting:
Some are harder than others.
transpose :: [[a]] -> [[a]]This one was very hard indeed. After an entire day of bashing my head against the wall, I discovered a few things I didn't know about Haskell syntax before.
For instance, I used to think that at the end of the list, there were infinite : [] : [] : [] and so you go because if xs in (x : xs) could be infinite, why not : []?
Things I try to do for each of the functions I'm rewriting:
- I try to figure out the type on my own. So far, this one seems to go fine.
- I write it / bash my head against the wall.
- I import QuickCheck, and write a test to compare my version versus the Data.List version. e.g.
- testx a l = x a l === Data.List.x a l
- It is incredibly handy not to have to write something to test your functions on. When I was learning C, that was rather annoying.
Saturday, 26 July 2014
Today, We Have Divided My Household
I switched to emacs today after the PB informed me that it doesn't have modes.
So far so good. I like it better than Vim and it's annoying modes, certainly.
There will be further reports on this matter. In the meantime, I appropriated the PB's hard copy of Learn You a Haskell for a Great Good and need to continue with my studies.
PS This post is powered by mini oranges.
So far so good. I like it better than Vim and it's annoying modes, certainly.
There will be further reports on this matter. In the meantime, I appropriated the PB's hard copy of Learn You a Haskell for a Great Good and need to continue with my studies.
PS This post is powered by mini oranges.
Tuesday, 22 July 2014
Beginning My Induction into the Cult of Haskell
The Programmer Boyfriend (henceforth PB) is a card-carrying member of the Cult of Haskell. For the purposes of this blog, it is perhaps the most important thing to note about him. As far as he is concerned, Haskell is religion. Indeed, he speaks more poetically of Haskell than he does of his love for me.
Naturally, my first attempt to learn programming involved Haskell. It failed terribly. It nearly put me off programming forever. A friend of mine, when told that the PB was intending to start me off with Haskell, informed me that I would either go crazy or become a genius.
Then we moved onto Racket (with How to Design Programs and Structure and Interpretation of Computer Programs) and C (The C Programming Language).
(I have not finished reading any of the above the textbooks.)
After C, the PB figures that I would be much more open to Haskell, so here we are giving this another try.
I will be reading/working through Real World Haskell and Learn You a Haskell for a Great Good concurrently.
Naturally, my first attempt to learn programming involved Haskell. It failed terribly. It nearly put me off programming forever. A friend of mine, when told that the PB was intending to start me off with Haskell, informed me that I would either go crazy or become a genius.
Then we moved onto Racket (with How to Design Programs and Structure and Interpretation of Computer Programs) and C (The C Programming Language).
(I have not finished reading any of the above the textbooks.)
After C, the PB figures that I would be much more open to Haskell, so here we are giving this another try.
I will be reading/working through Real World Haskell and Learn You a Haskell for a Great Good concurrently.
Subscribe to:
Posts (Atom)