Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "haskell"


Relearn You a Haskell (Part 2: List Comprehensions, Tuples, and Types)

  • Another way of looking at it is that we first take the list of all numbers [1..10] and filter them through the predicate (mod x 2 == 0 means we only take the even numbers 2, 4, 6, 8, 10) and then square those numbers (so we end up with 4, 16, 36, 64, 100).
  • This list comprehension generates prime numbers.
  • Haskell classes (also called typeclasses) are sort of like Java interfaces in that any child class derived from a particular parent class is guaranteed to implement some specific behaviour.
  • All numeric types, as well as Chars and lists, extend the Ord class.
  • As always, Learn You a Haskell has a great explanation of types and classes, and goes into more detail than I have here.
  • I hope this post has jogged your memory a bit about working with list comprehensions, tuples, and types in Haskell.

save | comments | report | share on


Relearn You a Haskell (Part 2: List Comprehensions, Tuples, and Types)

  • Another way of looking at it is that we first take the list of all numbers [1..10] and filter them through the predicate (mod x 2 == 0 means we only take the even numbers 2, 4, 6, 8, 10) and then square those numbers (so we end up with 4, 16, 36, 64, 100).
  • This list comprehension generates prime numbers.
  • Haskell classes (also called typeclasses) are sort of like Java interfaces in that any child class derived from a particular parent class is guaranteed to implement some specific behaviour.
  • All numeric types, as well as Chars and lists, extend the Ord class.
  • As always, Learn You a Haskell has a great explanation of types and classes, and goes into more detail than I have here.
  • I hope this post has jogged your memory a bit about working with list comprehensions, tuples, and types in Haskell.

save | comments | report | share on