Language.PureScript.Ide.Imports

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.Ide.Imports

Description

Provides functionality to manage imports

Synopsis

- parseImportsFromFile :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [(ModuleName, ImportDeclarationType, Maybe ModuleName)])
- parseImportsFromFile' :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [Text], [Import], [Text])
- parseImport :: Text -> Maybe Import
- prettyPrintImportSection :: [Import] -> [Text]
- sliceImportSection :: [Text] -> Either Text (ModuleName, [Text], [Import], [Text])
- prettyPrintImport' :: Import -> Text
- data Import = Import ModuleName ImportDeclarationType (Maybe ModuleName)

# Documentation

parseImportsFromFile :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [(ModuleName, ImportDeclarationType, Maybe ModuleName)]) #

Reads a file and returns the parsed module name as well as the parsed imports, while ignoring eventual parse errors that aren't relevant to the import section

parseImportsFromFile' :: (MonadIO m, MonadError IdeError m) => FilePath -> m (ModuleName, [Text], [Import], [Text]) #

Reads a file and returns the (lines before the imports, the imports, the lines after the imports)

parseImport :: Text -> Maybe Import #

Test and ghci helper

prettyPrintImportSection :: [Import] -> [Text] #

sliceImportSection :: [Text] -> Either Text (ModuleName, [Text], [Import], [Text]) #

prettyPrintImport' :: Import -> Text #

data Import #

Constructors

Import ModuleName ImportDeclarationType (Maybe ModuleName) |

#### Instances

Instances details

Show Import # |
Instance details Defined in Language.PureScript.Ide.Imports Methods showsPrec :: Int -> Import -> ShowS # show :: Import -> String # showList :: [Import] -> ShowS #
Eq Import # |
Instance details Defined in Language.PureScript.Ide.Imports Methods (==) :: Import -> Import -> Bool # (/=) :: Import -> Import -> Bool #