dhall-lsp-server-1.1.1: Language Server Protocol (LSP) server for Dhall
Safe HaskellNone
LanguageHaskell2010

Dhall.LSP.Backend.Dhall

Synopsis

Documentation

data FileIdentifier Source #

A FileIdentifier represents either a local file or a remote url.

fileIdentifierFromFilePath :: FilePath -> FileIdentifier Source #

Construct a FileIdentifier from a local file path.

fileIdentifierFromURI :: URI -> Maybe FileIdentifier Source #

Construct a FileIdentifier from a given URI. Supports only "file:" URIs.

hashNormalToCode :: Normal -> Text Source #

Given a normal expression compute the hash (using the default standard version) of its alpha-normal form. Returns the hash in the format used in Dhall's hash annotations (prefixed by "sha256:" and base-64 encoded).

data WellTyped Source #

A well-typed expression.

data Normal Source #

A fully normalised expression.

data Cache Source #

A cache maps Dhall imports to fully normalised expressions. By reusing caches we can speeds up diagnostics etc. significantly!

emptyCache :: Cache Source #

The initial cache.

invalidate :: FileIdentifier -> Cache -> Cache Source #

Invalidate any _unhashed_ imports of the given file. Hashed imports are kept around as per https://github.com/dhall-lang/dhall-lang/blob/master/standard/imports.md. Transitively invalidates any imports depending on the changed file.

data DhallError Source #

A Dhall error. Covers parsing, resolving of imports, typechecking and normalisation.

parse :: Text -> Either DhallError (Expr Src Import) Source #

Parse a Dhall expression.

parseWithHeader :: Text -> Either DhallError (Header, Expr Src Import) Source #

Parse a Dhall expression along with its "header", i.e. whitespace and comments prefixing the actual code.

load :: FileIdentifier -> Expr Src Import -> Cache -> IO (Either DhallError (Cache, Expr Src Void)) Source #

Resolve all imports in an expression.

typecheck :: Expr Src Void -> Either DhallError (WellTyped, WellTyped) Source #

Typecheck a fully resolved expression. Returns a certification that the input was well-typed along with its (well-typed) type.

normalize :: WellTyped -> Normal Source #

Normalise a well-typed expression.