-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Language support for the PureScript programming language
--
-- Please see README.md
@package psc-ide
@version 0.2.0.0
module PureScript.Ide.Types
type ModuleIdent = Text
type DeclIdent = Text
type Type = Text
data Fixity
Infix :: Fixity
Infixl :: Fixity
Infixr :: Fixity
data ExternDecl
FunctionDecl :: DeclIdent -> Type -> ExternDecl
[functionName] :: ExternDecl -> DeclIdent
[functionType] :: ExternDecl -> Type
FixityDeclaration :: Fixity -> Int -> DeclIdent -> ExternDecl
Dependency :: ModuleIdent -> [Text] -> ExternDecl
[dependencyModule] :: ExternDecl -> ModuleIdent
[dependencyNames] :: ExternDecl -> [Text]
ModuleDecl :: ModuleIdent -> [DeclIdent] -> ExternDecl
DataDecl :: DeclIdent -> Text -> ExternDecl
type Module = (ModuleIdent, [ExternDecl])
data PscState
PscState :: Map Text [ExternDecl] -> PscState
[pscStateModules] :: PscState -> Map Text [ExternDecl]
emptyPscState :: PscState
newtype Completion
Completion :: (ModuleIdent, DeclIdent, Type) -> Completion
data Success
CompletionResult :: [Completion] -> Success
TextResult :: Text -> Success
encodeSuccess :: (ToJSON a) => a -> Value
newtype Filter
Filter :: ([Module] -> [Module]) -> Filter
newtype Matcher
Matcher :: ([Completion] -> [Completion]) -> Matcher
instance GHC.Classes.Eq PureScript.Ide.Types.Success
instance GHC.Show.Show PureScript.Ide.Types.Success
instance GHC.Classes.Eq PureScript.Ide.Types.Completion
instance GHC.Show.Show PureScript.Ide.Types.Completion
instance GHC.Classes.Eq PureScript.Ide.Types.PscState
instance GHC.Show.Show PureScript.Ide.Types.PscState
instance GHC.Classes.Eq PureScript.Ide.Types.ExternDecl
instance GHC.Show.Show PureScript.Ide.Types.ExternDecl
instance GHC.Classes.Eq PureScript.Ide.Types.Fixity
instance GHC.Show.Show PureScript.Ide.Types.Fixity
instance Data.Aeson.Types.Class.FromJSON PureScript.Ide.Types.Completion
instance Data.Aeson.Types.Class.ToJSON PureScript.Ide.Types.Completion
instance Data.Aeson.Types.Class.ToJSON PureScript.Ide.Types.Success
module PureScript.Ide.Matcher
-- | Matches any occurence of the search string with intersections | | The
-- scoring measures how far the matches span the string where | closer is
-- better. | Examples: | flMa matches flexMatcher. Score: 14.28 | sons
-- matches sortCompletions. Score: 6.25
flexMatcher :: Text -> Matcher
runMatcher :: Matcher -> [Completion] -> [Completion]
module PureScript.Ide.Filter
-- | Only keeps the given Modules
moduleFilter :: [ModuleIdent] -> Filter
-- | Only keeps Identifiers that start with the given prefix
prefixFilter :: Text -> Filter
-- | Only keeps Identifiers that are equal to the search string
equalityFilter :: Text -> Filter
-- | Only keeps the given Modules and all of their dependencies
dependencyFilter :: [ModuleIdent] -> Filter
runFilter :: Filter -> [Module] -> [Module]
module PureScript.Ide.Command
data Command
Load :: [ModuleIdent] -> [ModuleIdent] -> Command
[loadModules] :: Command -> [ModuleIdent]
[loadDependencies] :: Command -> [ModuleIdent]
Type :: DeclIdent -> [Filter] -> Command
[typeSearch] :: Command -> DeclIdent
[typeFilters] :: Command -> [Filter]
Complete :: [Filter] -> Matcher -> Command
[completeFilters] :: Command -> [Filter]
[completeMatcher] :: Command -> Matcher
List :: Command
Cwd :: Command
Quit :: Command
instance Data.Aeson.Types.Class.FromJSON PureScript.Ide.Command.Command
instance Data.Aeson.Types.Class.FromJSON PureScript.Ide.Types.Filter
instance Data.Aeson.Types.Class.FromJSON PureScript.Ide.Types.Matcher
module PureScript.Ide.Error
type ErrorMsg = String
data Error
GeneralError :: ErrorMsg -> Error
NotFound :: Text -> Error
ModuleNotFound :: ModuleIdent -> Error
ModuleFileNotFound :: ModuleIdent -> Error
ParseError :: ParseError -> ErrorMsg -> Error
textError :: Error -> Text
-- | Specialized version of first from Bifunctors
first :: (a -> b) -> Either a r -> Either b r
instance GHC.Classes.Eq PureScript.Ide.Error.Error
instance GHC.Show.Show PureScript.Ide.Error.Error
instance Data.Aeson.Types.Class.ToJSON PureScript.Ide.Error.Error
module PureScript.Ide.Externs
data ExternDecl
FunctionDecl :: DeclIdent -> Type -> ExternDecl
[functionName] :: ExternDecl -> DeclIdent
[functionType] :: ExternDecl -> Type
FixityDeclaration :: Fixity -> Int -> DeclIdent -> ExternDecl
Dependency :: ModuleIdent -> [Text] -> ExternDecl
[dependencyModule] :: ExternDecl -> ModuleIdent
[dependencyNames] :: ExternDecl -> [Text]
ModuleDecl :: ModuleIdent -> [DeclIdent] -> ExternDecl
DataDecl :: DeclIdent -> Text -> ExternDecl
type ModuleIdent = Text
type DeclIdent = Text
type Type = Text
data Fixity
Infix :: Fixity
Infixl :: Fixity
Infixr :: Fixity
-- | Parses an extern file into the ExternDecl format.
readExternFile :: FilePath -> IO (Either Error [ExternDecl])
parseExtern :: Text -> Either Error ExternDecl
parseExternDecl :: Parser ExternDecl
typeParse :: Text -> Either Text (Text, Text)
module PureScript.Ide.Pursuit
queryUrl :: Text
jsonOpts :: Options
myZip :: [a] -> [(b, c)] -> [(a, b, c)]
searchPursuit :: Text -> IO [Completion]
module PureScript.Ide.CodecJSON
encodeT :: (ToJSON a) => a -> Text
decodeT :: (FromJSON a) => Text -> Maybe a
instance Data.Aeson.Types.Class.ToJSON PureScript.Ide.Types.ExternDecl
module PureScript.Ide.Completion
-- | Applies the CompletionFilters and the Matcher to the given Modules and
-- sorts the found Completions according to the Matching Score
getCompletions :: [Filter] -> Matcher -> [Module] -> [Completion]
getExactMatches :: DeclIdent -> [Filter] -> [Module] -> [Completion]
module PureScript.Ide
type PscIde = StateT PscState IO
getAllDecls :: PscIde [ExternDecl]
getAllModules :: PscIde [Module]
findCompletions :: [Filter] -> Matcher -> PscIde Success
findType :: DeclIdent -> [Filter] -> PscIde Success
findPursuitCompletions :: Text -> PscIde [Completion]
loadExtern :: FilePath -> PscIde (Either Error ())
getDependenciesForModule :: ModuleIdent -> PscIde (Maybe [ModuleIdent])
moduleFromDecls :: [ExternDecl] -> Either Error Module
stateFromDecls :: [[ExternDecl]] -> Either Error PscState
printModules :: PscIde Success
-- | The first argument is a set of modules to load. The second argument
-- denotes modules for which to load dependencies
loadModulesAndDeps :: [ModuleIdent] -> [ModuleIdent] -> PscIde (Either Error Success)
loadModuleDependencies :: ModuleIdent -> PscIde (Either Error Text)
loadModule :: ModuleIdent -> PscIde (Either Error Text)
filePathFromModule :: ModuleIdent -> IO (Either Error FilePath)
-- | Taken from Data.Either.Utils
maybeToEither :: MonadError e m => e -> Maybe a -> m a