stan-0.0.1.0: Haskell STatic ANalyser
Copyright(c) 2020 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Stan.Hie

Description

Functions to work with hie specific parts.

Synopsis

Documentation

readHieFiles :: FilePath -> IO [HieFile] Source #

Returns contents of all .hie files recursively in the given hie directory.

countLinesOfCode :: HieFile -> Int Source #

Get the number of lines of code in the file by analising HieFile.

eqAst :: forall a. Eq a => HieFile -> HieAST a -> HieAST a -> Bool Source #

Compare two AST nodes on equality. This is a more relaxed version of the Eq instance for HieAST because it doesn't compare source locations. This function is useful if you want to check whether two AST nodes represent the same AST.

This function needs to take the original HieFile because constants are not stored in HieAST and to compare constants we need to compare parts of source code.

slice :: RealSrcSpan -> ByteString -> Maybe ByteString Source #

Take sub-bytestring according to a given span.

When the given source is empty returns Nothing.

TODO: currently works only with single-line spans