user1010130
user1010130

Reputation: 11

parse error (possibly incorrect indentation)

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.

Upvotes: 0

Views: 4462

Answers (2)

Satvik
Satvik

Reputation: 11208

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.

Upvotes: 1

dave4420
dave4420

Reputation: 47052

The lines defining substitute are indented more than the lines defining other values. Unindent them.

Upvotes: 1

Related Questions