当我执行以下代码行时,我得到以下错误
TyInfer.hs:115:0: parse error (possibly incorrect indentation)谁能给我解释一下问题出在哪里?
type Subst = [(TyVar, Type)]
-- ---------------------------------------------------------------------
-- Unification
--
unify :: Type -> Type -> Subst
unify t1 t2 = error "substBnd: implement me"
-- ---------------------------------------------------------------------
-- Replace variables in the type with the types in the Subst
--
line: no 115: substitute :: Subst -> Type -> Type
substitute [( _ , t2)] tv = tv <- t2
-- ---------------------------------------------------------------------
-- Replace variables in the type annotations of a Bind, Expr, or Alt
--
substBnd :: Subst -> Bind -> Bind
substBnd _ _ = error "substBnd: implement me"谢谢。
发布于 2011-10-24 10:24:07
定义substitute的行比定义其他值的行缩进更多。取消它们的缩进。
发布于 2011-10-24 12:03:24
替换的缩进及其定义不正确。tv<-t2没有任何意义。请更清楚您打算用替换函数来做什么。
https://stackoverflow.com/questions/7870673
复制相似问题