解析错误(可能是不正确的缩进)
当我执行以下代码行时,出现以下错误,
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"
谢谢。
when i execute the following lines of code i get the following error
TyInfer.hs:115:0: parse error (possibly incorrect indentation)
can anyone explain me what is the problem.
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"
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
定义
substitute
的行比定义其他值的行缩进更多。取消缩进。The lines defining
substitute
are indented more than the lines defining other values. Unindent them.替代品的缩进及其定义不正确。 tv<-t2 没有任何意义。请更清楚地说明您打算使用替代功能做什么。
The indentation of substitute as well as its definition are not correct . tv<-t2 does not make any sense . please be more clear what you intend to do with the substitute function.