language-ats-0.2.0.0: src/Language/ATS.hs
-- | Main module for the library
module Language.ATS ( -- * Functions for working with syntax
lexATS
, parseATS
, parseATS'
, printATS
, printATSCustom
, printATSFast
-- * Library functions
, getDependencies
-- * Syntax Tree
, ATS (..)
, Declaration (..)
, Expression (..)
, Type (..)
, Function (..)
, Implementation (..)
, Pattern (..)
, Name (..)
, UnOp (..)
, BinOp (..)
, DataPropLeaf (..)
, Leaf (..)
, Arg (..)
, Addendum (..)
, LambdaType (..)
, Universal (..)
, Existential (..)
, PreFunction (..)
, StaticExpression (..)
, StackFunction (..)
, Paired (..)
, Fixity (..)
, SortArg (..)
, Sort (..)
-- * Lexical types
, Token (..)
, AlexPosn (..)
, Keyword (..)
-- * Error types
, ATSError
-- * Lenses
, leaves
, constructorUniversals
, typeCall
, typeCallArgs
) where
import Data.Maybe (catMaybes)
import Language.ATS.Lexer
import Language.ATS.Parser
import Language.ATS.PrettyPrint
import Language.ATS.Types
-- | Parse a string containing ATS source.
parseATS' :: String -> Either (ATSError String) ATS
parseATS' = parseATS . lexATS
getDependencies :: ATS -> [FilePath]
getDependencies (ATS ds) = catMaybes (g <$> ds)
where g (Staload _ _ s) = Just s
g (Include s) = Just s
g _ = Nothing