guthrie
guthrie

Reputation: 4609

Haskell := operator?

http://www.haskell.org/haskellwiki/Memoization

Shows this:

  Map ()            b  := b
  Map (Either a a') b  := (Map a b, Map a' b)
  Map (a,a')        b  := Map a (Map a' b)

No doubt something simple, but I don't recognize the syntax, and neither Google nor I know what the ":=" operator does. :-) Looks like an overloaded constructor definition, perhaps for the Assoc class?

An old (Davies) Haskell book shows this in a PreludeArray module, but I don't find that around anymore.

Upvotes: 2

Views: 1027

Answers (1)

sclv
sclv

Reputation: 38893

In the case of that webpage, := isn't used as a real operator. Read it as "translates to" or "is isomorphic to".

Upvotes: 7

Related Questions