@@ -353,13 +353,19 @@ handleBrowse moduleName = do
353353 moduleToPath :: String -> FilePath
354354 moduleToPath = (pathSeparator:) . (++ ".purs") . map (\x -> if x == '.' then pathSeparator else x) . N.runModuleName . N.moduleNameFromString
355355
356+ -- HACK - permit to `:b` prelude modules - I do not know better
357+ preludeModules = ["Prelude", "Data.Function", "Data.Eq", "Prelude.Unsafe",
358+ "Control.Monad.Eff", "Control.Monad.Eff.Unsafe",
359+ "Debug.Trace", "Control.Monad.ST"]
360+
356361 -- find the fully qualified module path (key to full module) - "" if not found
357362 findModulePath :: [FilePath] -> String -> Either String FilePath
358363 findModulePath _ [] = Left "Module must be specified."
359− findModulePath filePaths modName = let partialModulePath = moduleToPath modName in
360− case filter (isInfixOf partialModulePath) filePaths of
361− [] -> Left $ "Module ('" ++ modName ++ "','" ++ partialModulePath ++ "') was not found."
362− (x:_) -> Right x
364+ findModulePath filePaths modName =
365+ let partialModulePath = if modName `elem` preludeModules then "/prelude/prelude.purs" else moduleToPath modName in
366+ case filter (isInfixOf partialModulePath) filePaths of
367+ [] -> Left $ "Module ('" ++ modName ++ "','" ++ partialModulePath ++ "') was not found."
368+ (x:_) -> Right x
363369
364370 -- retrieve explicit types
365371 getSignature (P.PositionedDeclaration _ d) = getSignature d