@@ -12,13 +12,19 @@ import Patterns
1212import Binops
1313
1414import Guid
15−import Types (Type (VarT))
15+import Types (Type (VarT), Scheme (Forall))
1616
1717
1818-------- Basic Terms --------
1919
2020numTerm :: (Monad m) => ParsecT [Char] u m Expr
21−numTerm = liftM (Number . read) (many1 digit) <?> "number"
21+numTerm = toExpr <$> (preNum <?> "number")
22+ where toExpr n | '.' `elem` n = FloatNum (read n)
23+ | otherwise = IntNum (read n)
24+ preNum = (++) <$> many1 digit <*> option "" postNum
25+ postNum = do try $ lookAhead (string "." >> digit)
26+ string "."
27+ ('.':) <$> many1 digit
2228
2329strTerm :: (Monad m) => ParsecT [Char] u m Expr
2430strTerm = liftM Str . expecting "string" . betwixt '"' '"' . many $
@@ -113,7 +119,7 @@ assignExpr = do
113119
114120
115121def = do (fs,es) <- unzip <$> assignExpr
116− return (fs, es, mapM (\_ -> liftM VarT guid) fs)
122+ return (fs, es, map (\_ -> Forall [0] [] (VarT 0)) fs)
117123
118124parseDef str =
119125 case parse def "" str of