
Conrad Barski's Haskell Tutorial - icey
http://lisperati.com/haskell/
======
drcode
Wow, how did my Haskell tutorial get to the HN front page out of nowhere? :-)

If you like my stuff, keep an eye out for my new Bitcoin book, which will be
coming out this fall. I've been slaving over the artwork for months, it should
be a beautiful book! The working title is "Bitcoins for the Befuddled".

~~~
binarycrusader
Thanks for the wonderful Land of Lisp book!

I only wish someone would do a similar "Land of C" book some day :-)

~~~
victorf
I haven't read that one, and I am looking for an into to Lisp book. What did
you like about it?

(and I think it would be a missed opportunity to not title it "Sea of C")

~~~
binarycrusader
To be clear, I haven't finished the book yet, but I made it through the first
eleven chapters (~230 pages) so I think I've gone through enough material to
render a reasonable opinion. With that disclaimer out of the way...

I love that the author chose to expose readers to core, foundational concepts
through example programs that were continually improved instead of using lots
of throwaway one-off examples.

Put differently, the author managed to ensure that readers that diligently
followed through from beginning to end would gain a real sense of progression
as they went through the material.

The only complaint I really have so far is Chapter 11 -- but that's not really
the author's fault; that's just the terrifyingly mind-numbing formatting
functionality (Common?) Lisp offers.

------
lelf
> _In Haskell, this type of integer can 't get bigger than 2^31..._

It's platform-dependent

    
    
      h> finiteBitSize (0 :: Int)
      64
    

> _We could have used the type Integer instead- This type of integer grows
> "magically" and can hold any sized integer, no matter how big... but it's
> slower, so we used Int instead, since our numbers will never get that big._

Premature optimisation at its best.

~~~
pogden
In Haskell you can also use the Integral typeclass to make functions
polymorphic to Int and Integer.

~~~
lelf
And why would you do this in simple tutorial program? Anyway, you'd need Num.

~~~
dfeltey
I don't know why anyone would use the Integral typeclass over just Int or
Integer in a simple program like this, but you wouldn't need Num in addition
to Integral, every instance of Integral must also be an instance of Real, and
instances of Real must be instances of Num.

------
apgwoz
Picnicmob was a really clever idea. I think I remember that it got cancelled
though, which was unfortunate.

I like the tutorial though. I'd be willing to bet it's his style and work that
inspired the "Learn you a..." books. The Haskell one is great, and so is the
Erlang one.

~~~
seako
don't forget _why's (poignant) guide to ruby
[http://mislav.uniqpath.com/poignant-
guide/](http://mislav.uniqpath.com/poignant-guide/)

~~~
victorf
I hated that book, the signal to goofy joke ratio was awful. Compare with,
say, "Learn you an Erlang", which was goofy while still informative.

------
gtani
My local Barnes and Noble has this book next to Felleisen et al's "Realm of
Racket". These will be hours and cups of coffee well spent!

[http://realmofracket.com/](http://realmofracket.com/)

------
gps408
Simple and refined, guaranteed to blow your mind...

The tao of regular expressions link is broken in the first chapter. Does
anyone have a link?

------
reirob
I like the tutorial very much! Thank you! And I like the final words, which I
think brings to the point the whole discussion about Haskell vs. Imperative
languages:

    
    
      [..] Because the physical world changes only slightly 
      from moment to moment, it means that languages that 
      can comfortably mutate large data structures in targeted
      ways will always have a role to play in real-world
      software- The "real world" usually just doesn't work the
      way Haskell, and other functional languages would prefer
      it did: Haskell preferred that at every moment in time, a
      "new universe" would look at the "old universe" and would
      rebuild itself, from scratch, from what it saw in the
      past, with radical changes happening all the time.
    
      Despite its many advantages, I humbly suggest, therefore,
      that in the future there will continue to be a rift
      between the "imperative" and "functional" camps of
      programming, until someone comes up with a truly robust
      way of uniting these two camps- And I think that some
      profound programming discoveries still need to be made in
      the future before this problem is really resolved- I get
      the feeling it's just not good enough to wave at the
      problem and say "Monads".

------
frou_dh
ghc 7.6.3 (brew) installed on OS X doesn't like the first code presented
(System.Random, Text.Regex and StdGen aren't found).

~~~
mietek
`brew install haskell-platform` should help.

------
izietto
I'm unsure which regex package flavor to use... regex-base? regex-compat?
regex-pcre? regex-???

~~~
blaenk
This confused me when I was learning Haskell as well. The way I understand it
is that regex-base defines a base-line interface -- such as the context-aware
=~ function -- that all of the other packages implement, which is why they're
known as 'backends' (e.g. regex-tdfa, regex-pcre, etc.).

In newer versions of GHC (> 6.6), the backends re-export this interface so
that you just need to import the backend. regex-tdfa is the backend that I've
used myself, mainly because I saw it used in other packages (Hakyll).

[http://www.haskell.org/haskellwiki/Regular_expressions#regex...](http://www.haskell.org/haskellwiki/Regular_expressions#regex-
base)

------
monokrome
This website was written on a planet where 244 lines of Haskell is less than
100 lines of Haskell.

~~~
drcode
That's why there's a footnote on the front page:

[1] - Lines of active code only, not counting optional function signatures.
Intermediate debug output lines excluded. May cause eye irritation if viewed
for prolonged periods of time. Speak to your physician to find out if this
tutorial is the best treatment option for you.

