首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >解析错误(可能是不正确的缩进)

解析错误(可能是不正确的缩进)
EN

Stack Overflow用户
提问于 2011-10-24 09:59:40
回答 2查看 4.4K关注 0票数 0

当我执行以下代码行时,我得到以下错误

代码语言:javascript
复制
TyInfer.hs:115:0: parse error (possibly incorrect indentation)

谁能给我解释一下问题出在哪里?

代码语言:javascript
复制
  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"

谢谢。

EN

回答 2

Stack Overflow用户

发布于 2011-10-24 10:24:07

定义substitute的行比定义其他值的行缩进更多。取消它们的缩进。

票数 1
EN

Stack Overflow用户

发布于 2011-10-24 12:03:24

替换的缩进及其定义不正确。tv<-t2没有任何意义。请更清楚您打算用替换函数来做什么。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7870673

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档