Things I figured out about Haskell today
Jul. 30th, 2009 11:07 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
- 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."
(no subject)
Date: 2009-07-30 10:34 pm (UTC)(no subject)
From:(no subject)
Date: 2009-07-30 10:59 pm (UTC)(no subject)
Date: 2009-08-01 03:20 pm (UTC)(no subject)
From:(no subject)
From:even the greeks had trouble with monads
Date: 2009-08-03 03:03 pm (UTC)so don't feel bad :-)
(no subject)
Date: 2009-08-04 07:32 pm (UTC)(no subject)
From:? is not Maybe
Date: 2009-08-08 08:43 pm (UTC)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.)