-1
次のエラーが表示されるので、コードに何が間違っているか説明してください。解析エラー(インデントが間違っている可能性があります)
105:0: parse error (possibly incorrect indentation)
これはコードです:
-- Type inference for expressions
--
tyInf :: Gamma -> Exp -> TC (Exp, Type, Subst)
tyInf g (Num n) = return (Num n, intTyCon, [([intId], intTyCon)])
tyInf g (Con tag[])
| tag == unitTag = return (Con tag[],unitTyCon,[([unitId], unitTyCon)])
| tag == falseTag = return (Con tag[], boolTyCon, [([boolId],boolTyCon)])
| tag == trueTag = return (Con tag[],boolTyCon, [([boolId],boolTyCon)])
| otherwise = error "unknown constructor"
tyInf g (Con tag [ e1, e2]) | tag == pairTag = do
return ((Con tag [ e1, e1], (mkPairTy (tyInf g e1) (tyInf g e2)),
[([pairId], (mkPairTy (tyInf g e1) (tyInf g e2)))])
-- ---------------------------------------------------------------------
-- The type for a unifier. A value of this type maps free
-- type variables to real types.
--
-- You may change this type if you wish. The following is
-- one possible type, though not necessarily the best.
--
type Subst = [([TyVar], Type)] -- <--- This is line 105
-- --------------------------------------------------------------------
-- Unification
--
unify :: Type -> Type -> Subst
unify t1 t2
| t1 == t2 = []
| otherwise = [(tyVarsIn t1, t2)]
その行が正しくインデントされているかどうかを確認しましたか? – MatrixFrog