Introduction to the Haskell programming language for Ruby programmers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Peter J. Jones 9744b8ad92 Add some notes about bufshow in slides.el 6 years ago
src Add a new slide and article link 6 years ago And another set of slides that show top and bottom 6 years ago
slides.el Add some notes about bufshow in slides.el 6 years ago

Topics and Goals

What is Ruby?

What is Haskell?

Haskell Basics


Defining Functions

Function Types and Type Classes

User Defined Types

Some Real World Haskell

Why I Like Haskell

Writing Better Ruby

Learning Haskell

Things to Keep In Mind

Getting Help

    :PROPERTIES: :ID: 868720b6-d686-4eb8-b855-dccae37b1f4f :END:
  1. The primary properties of Ruby and Haskell
  2. Learn the basics of Haskell (functions and types)
  3. Haskell lessons for writing better Ruby code
  4. :PROPERTIES: :ID: f4b8e166-e1a1-406c-b0db-3f4a64b511d0 :END:
  5. Imperative and object-oriented
  6. Objects are first-class citizens
  7. Nearly everything is mutable
  8. Dynamically typed with a class-based type system
  9. Strict evaluation
  10. Interpreted
  11. :PROPERTIES: :ID: 1d0968dd-4cbb-43a3-8fe4-3d82a092075e :END:
  12. Declarative and purely functional
  13. Functions are first-class citizens
  14. Functions are not allowed to have side effects (no state)
  15. Statically typed with a strong type system
  16. Non-strict evaluation (lazy evaluation)
  17. Compiled (native object code) or interpreted
  18. Braces and semicolons or
  19. Layout (use indentation like Python)
  20. Name and arguments go on the left-hand side of the equals sign
  21. The body of the function goes on the right-hand side
  22. Functions must produce the same result given the same arguments
  23. The only "data" a function can see are its arguments
  24. The compiler can infer type information automatically
  25. You can also manually specify type information
  26. Giving explicit type information gives the compiler something to
  27. check against (what you expect vs. is really given)
  28. When you give type information you can use:
  29. Specific types (e.g. Int, Bool)
  30. Type variables (e.g. a)
  31. Type classes (e.g. Num a =>)
  32. That is, functions can be polymorphic
  33. Some types to review
  34. Bool
  35. Person (user-defined type in types.hs)
  36. Maybe
  37. Difference between type constructors and value constructors
  38. Pattern matching and value constructors
  39. Implementing the Unix wc utility
  40. Rock-paper-scissors
  41. :PROPERTIES: :ID: 5c1d117f-28c3-4716-b4e9-bb2fb2dfad0d :END:
  42. Everything is very well thought out
  43. The syntax is beautiful and clean
  44. The type system is fantastic (type-driven development)
  45. Concurrency is a high-priority
  46. Function purity makes it easier to reason/understand
  47. The best of both worlds (interpreted vs. compiled)
  48. :PROPERTIES: :ID: bd40cdd6-c72f-4336-b7c5-6ffeb785a7b7 :END:
  49. Minimize side effects
  50. Use fewer instance variables
  51. Write simpler classes with fewer responsibilities
  52. Use nil less often?
  53. :PROPERTIES: :ID: 488e9b3e-ec72-4e9b-8973-97376004d885 :END:
  54. [][Learn You a Haskell]] (buy the book)
  55. [][Typeclassopedia]] (dig into Haskell types)
  56. [][Why Do Monads Matter?]] (great article)
  57. [][All About Monads]] (digs into each of the standard monads)
  58. [][IO inside]] (understand IO and side effects)
  59. Review Real World Haskell (the online version, watch for typos)
  60. Another checklist covering how to learn Haskell
  61. If Haskell is your first purely functional language it might take
  62. some time to get out of your imperative skin
  63. Haskell is based on abstract mathematical concepts such as
  64. category theory so expect to spend some time reviewing math texts
  65. Be sure to join the Haskell IRC channel
  66. Send private messages to lambdabot