@@ -13,19 +13,20 @@ import Types.Types
14hints :: GuidCounter [(String, Scheme)]
14hints :: GuidCounter [(String, Scheme)]
15hints = liftM catMaybes (mapM toScheme values)
15hints = liftM catMaybes (mapM toScheme values)
17− values :: [(String, String)]
17+ values :: [(String, String)]
18− values = addPrefixes (Map.toList (Map.map Map.toList Libs.libraries))
18+ values = addPrefixes (Map.toList (Map.map Map.toList Libs.libraries))
20− addPrefixes :: [(String,[(String, String)])] -> [(String, String)]
20+ addPrefixes :: [(String,[(String, String)])] -> [(String, String)]
21− addPrefixes = concatMap (\(m,vs) -> map (first (\n -> m ++ "." ++ n)) vs)
21+ addPrefixes = concatMap (\(m,vs) -> map (first (\n -> m ++ "." ++ n)) vs)
23− toScheme :: (String, String) -> GuidCounter (Maybe (String, Scheme))
23+ toScheme :: (String, String) -> GuidCounter (Maybe (String, Scheme))
24− toScheme (name, 't':'y':'p':'e':' ':_) = return Nothing
24+ toScheme (name, 't':'y':'p':'e':' ':_) = return Nothing
25− toScheme (name, 'd':'a':'t':'a':' ':_) = return Nothing
25+ toScheme (name, 'd':'a':'t':'a':' ':_) = return Nothing
26− toScheme (name, tipeString) =
26+ toScheme (name, tipeString) =
27− let err = "compiler error parsing type of " ++ name ++ ":\n" ++ tipeString in
27+ let err = "compiler error parsing type of " ++ name ++ ":\n" ++ tipeString
28− case iParse (fmap toType typeExpr) err tipeString of
28+ in case iParse (fmap toType typeExpr) err tipeString of
29− Left err -> error (show err)
29+ Left err -> error (show err)
30− Right tipe -> do scheme <- Subs.generalize [] =<< Subs.superize name tipe
31+ scheme <- Subs.generalize [] =<< Subs.superize name tipe
31− return (Just (name, scheme))
32+ return (Just (name, scheme))