Entry tags:
Things I figured out about Haskell today
- Maybe is the same thing as Kleene ? (the "zero or one" operator in regular expressions).
- A typeclass is the same thing as an STL concept, but a typeclass actually means it.
- instance means "We're going to make this data type an instance of this typeclass, and here's how."
? is not Maybe
Nope. The types are significantly different. Kleene ? operates on sets of sequences; Maybe is a constructor for a discriminated union:
extension(T?) = extension(T) union {[]}.
extension(Maybe T) = {Some t | t in extension(T)} union {Nothing}.
This is not just nitpicking, honestly :-)
(You seem to have typeclasses right.)