module Curry.Syntax
( module Curry.Syntax.Type
, module Curry.Syntax.Utils
, L.Token (..), L.Category (..), L.Attributes (..)
, unlit, unlitLexSource, unlitParseHeader, unlitParsePragmas, unlitParseModule
, lexSource, parseInterface, parseHeader, parsePragmas, parseModule, parseGoal
, ppModule, ppInterface, ppIDecl
, showModule
) where
import Curry.Base.Monad (CYM)
import Curry.Base.Span (Span)
import qualified Curry.Files.Unlit as U (unlit)
import qualified Curry.Syntax.Lexer as L
import qualified Curry.Syntax.Parser as P
import Curry.Syntax.Pretty (ppModule, ppInterface, ppIDecl)
import Curry.Syntax.ShowModule (showModule)
import Curry.Syntax.Type
import Curry.Syntax.Utils
unlit :: FilePath -> String -> CYM String
unlit :: FilePath -> FilePath -> CYM FilePath
unlit = FilePath -> FilePath -> CYM FilePath
U.unlit
unlitLexSource :: FilePath -> String -> CYM [(Span, L.Token)]
unlitLexSource :: FilePath -> FilePath -> CYM [(Span, Token)]
unlitLexSource fn :: FilePath
fn src :: FilePath
src = FilePath -> FilePath -> CYM FilePath
U.unlit FilePath
fn FilePath
src CYM FilePath
-> (FilePath -> CYM [(Span, Token)]) -> CYM [(Span, Token)]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FilePath -> FilePath -> CYM [(Span, Token)]
L.lexSource FilePath
fn
unlitParsePragmas :: FilePath -> String -> CYM (Module ())
unlitParsePragmas :: FilePath -> FilePath -> CYM (Module ())
unlitParsePragmas fn :: FilePath
fn src :: FilePath
src = FilePath -> FilePath -> CYM FilePath
U.unlit FilePath
fn FilePath
src CYM FilePath -> (FilePath -> CYM (Module ())) -> CYM (Module ())
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FilePath -> FilePath -> CYM (Module ())
P.parsePragmas FilePath
fn
unlitParseHeader :: FilePath -> String -> CYM (Module ())
fn :: FilePath
fn src :: FilePath
src = FilePath -> FilePath -> CYM FilePath
U.unlit FilePath
fn FilePath
src CYM FilePath -> (FilePath -> CYM (Module ())) -> CYM (Module ())
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FilePath -> FilePath -> CYM (Module ())
P.parseHeader FilePath
fn
unlitParseModule :: FilePath -> String -> CYM (Module ())
unlitParseModule :: FilePath -> FilePath -> CYM (Module ())
unlitParseModule fn :: FilePath
fn src :: FilePath
src = FilePath -> FilePath -> CYM FilePath
U.unlit FilePath
fn FilePath
src CYM FilePath -> (FilePath -> CYM (Module ())) -> CYM (Module ())
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FilePath -> FilePath -> CYM (Module ())
P.parseSource FilePath
fn
lexSource :: FilePath -> String -> CYM [(Span, L.Token)]
lexSource :: FilePath -> FilePath -> CYM [(Span, Token)]
lexSource = FilePath -> FilePath -> CYM [(Span, Token)]
L.lexSource
parseInterface :: FilePath -> String -> CYM Interface
parseInterface :: FilePath -> FilePath -> CYM Interface
parseInterface = FilePath -> FilePath -> CYM Interface
P.parseInterface
parsePragmas :: FilePath -> String -> CYM (Module ())
parsePragmas :: FilePath -> FilePath -> CYM (Module ())
parsePragmas = FilePath -> FilePath -> CYM (Module ())
P.parsePragmas
parseHeader :: FilePath -> String -> CYM (Module ())
= FilePath -> FilePath -> CYM (Module ())
P.parseHeader
parseModule :: FilePath -> String -> CYM (Module ())
parseModule :: FilePath -> FilePath -> CYM (Module ())
parseModule = FilePath -> FilePath -> CYM (Module ())
P.parseSource
parseGoal :: String -> CYM (Goal ())
parseGoal :: FilePath -> CYM (Goal ())
parseGoal = FilePath -> CYM (Goal ())
P.parseGoal