开发者

Haskell := operator?

开发者 https://www.devze.com 2023-03-14 14:20 出处:网络
http://开发者_如何学Gowww.haskell.org/haskellwiki/Memoization Shows this: Map ()b:= b Map (Either a a\') b:= (Map a b, Map a\' b)

http://开发者_如何学Gowww.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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号