1module Types.Hints (hints) where
3import Control.Arrow (first)
4import Control.Monad (liftM)
5import Data.Maybe (catMaybes)
6import qualified Data.Map as Map
8import qualified Libraries as Libs
9import Parse.Library (iParse)
11import qualified Types.Substitutions as Subs
14hints :: GuidCounter [(String, Scheme)]
15hints = liftM catMaybes (mapM toScheme values)
17 values :: [(String, String)]
18 values = addPrefixes (Map.toList (Map.map Map.toList Libs.libraries))
20 addPrefixes :: [(String,[(String, String)])] -> [(String, String)]
21 addPrefixes = concatMap (\(m,vs) -> map (first (\n -> m ++ "." ++ n)) vs)
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)
31 scheme <- Subs.generalize [] =<< Subs.superize name tipe
32 return (Just (name, scheme))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list