@@ -47,9 +47,10 @@ safeReadDocs name =
4747 , " and specify your versions of Elm and your OS" ]
4848 exitFailure
4949
50−firstModuleInterface :: Interfaces -> Either String (String, ModuleInterface)
50+firstModuleInterface :: [(String, ModuleInterface)] ->
51+ Either String (String, ModuleInterface)
5152firstModuleInterface interfaces =
52− case Map.toList interfaces of
53+ case interfaces of
5354 [] -> Left "No interfaces found in serialized Prelude!"
5455 iface:_ -> Right iface
5556
@@ -69,10 +70,4 @@ readDocs filePath = do
6970 hPutStrLn stderr err
7071 exitFailure
7172
72− -- Unwrapping the Right value here is safe since the whole above chain
73− -- returns a Right value. The toList/fromList is necessary because of a
74− -- problem with looking up keys in the Map after deserialization. Example
75− -- at https://gist.github.com/jsl/7294493.
76− -- TODO: try switching to Data.ByteString.Lazy.Char8
77− (Right ifaces, _) ->
78− return $ Map.fromList $ Map.toList ifaces
73+ (Right ifaces, _) -> return $ Map.fromList ifaces