maradydd: (Default)
[personal profile] maradydd
  • 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."
Now if I can just get my head around monads, I'm set.

? is not Maybe

Date: 2009-08-08 08:43 pm (UTC)
From: [identity profile] davidsarah.livejournal.com
"Maybe is the same thing as Kleene ? (the "zero or one" operator in regular expressions)."

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.)

Profile

maradydd: (Default)
maradydd

September 2010

S M T W T F S
   1234
567891011
12131415 161718
19202122232425
26 27282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags