阅读背景:

为什么这种类型变量不明确?

来源:互联网 

Cabbage.hs:

module Cabbage where 
class Cabbage a
  where foo :: a -> String      -- the parameter is only present for its type,
                                -- the parameter value will be ignored
        bar :: String -> a
quux :: Cabbage a => String -> a
quux s = bar (s ++ foo (undefined :: a))
module Cabbage where 
class Cabba



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: