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