- The primary properties of Ruby and Haskell
- Learn the basics of Haskell (functions and types)
- Haskell lessons for writing better Ruby code
- Imperative and object-oriented
- Objects are first-class citizens
- Nearly everything is mutable
- Dynamically typed with a class-based type system
- Strict evaluation
- Interpreted
- Declarative and purely functional
- Functions are first-class citizens
- Functions are not allowed to have side effects (no state)
- Statically typed with a strong type system
- Non-strict evaluation (lazy evaluation)
- Compiled (native object code) or interpreted
- Braces and semicolons or
- Layout (use indentation like Python)
- Name and arguments go on the left-hand side of the equals sign
- The body of the function goes on the right-hand side
- Functions must produce the same result given the same arguments
- The only “data” a function can see are its arguments
- The compiler can infer type information automatically
- You can also manually specify type information
- Giving explicit type information gives the compiler something to check against (what you expect vs. is really given)
- When you give type information you can use:
- Specific types (e.g. Int, Bool)
- Type variables (e.g. a)
- Type classes (e.g. Num a =>)
- That is, functions can be polymorphic
- Some types to review
- Bool
- Person (user-defined type in types.hs)
- Maybe
- Difference between type constructors and value constructors
- Pattern matching and value constructors
- Implementing the Unix wc utility
- Rock-paper-scissors
- Everything is very well thought out
- The syntax is beautiful and clean
- The type system is fantastic (type-driven development)
- Concurrency is a high-priority
- Function purity makes it easier to reason/understand
- The best of both worlds (interpreted vs. compiled)
- Minimize side effects
- Use fewer instance variables
- Write simpler classes with fewer responsibilities
- Use nil less often?
- Learn You a Haskell (buy the book)
- Typeclassopedia (dig into Haskell types)
- Why Do Monads Matter? (great article)
- All About Monads (digs into each of the standard monads)
- IO inside (understand IO and side effects)
- Review Real World Haskell (the online version, watch for typos)
- Another checklist covering how to learn Haskell
- If Haskell is your first purely functional language it might take some time to get out of your imperative skin
- Haskell is based on abstract mathematical concepts such as category theory so expect to spend some time reviewing math texts
- Be sure to join the Haskell IRC channel
- Send private messages to lambdabot