【发布时间】:2011-08-19 12:14:51
【问题描述】:
当我向 GHC 提交代码时
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, ScopedTypeVariables #-}
class Modular s a | s -> a where modulus :: s -> a
newtype M s a = M {unM :: a} deriving (Eq, Show)
normalize :: (Modular s a, Integral a) => a -> M s a
normalize x :: M s a = M (x `mod` (modulus (undefined :: s)))
我收到以下错误:
config1.hs:10:1: Parse error in pattern: normalize
你能帮忙吗?
埃里克·麦考利
【问题讨论】:
标签: haskell parse-error type-variables