uhc-util-0.1.7.0: UHC utilities

Safe HaskellSafe
LanguageHaskell98

UHC.Util.CompileRun

Synopsis

Documentation

data CompileRun nm unit info err Source #

Constructors

CompileRun 

Fields

type CompilePhase n u i e a = StateT (CompileRun n u i e) IO a Source #

data CompilePhaseT n u i e m a Source #

CompileRun as state in specific StateT variant with non standard >>= newtype CompilePhaseT n u i e m a = CompilePhaseT {runCompilePhaseT :: CompileRun n u i e -> m (a, CompileRun n u i e)}

Instances

CompileRunner state n pos loc u i e m => Monad (CompilePhaseT n u i e m) Source # 

Methods

(>>=) :: CompilePhaseT n u i e m a -> (a -> CompilePhaseT n u i e m b) -> CompilePhaseT n u i e m b #

(>>) :: CompilePhaseT n u i e m a -> CompilePhaseT n u i e m b -> CompilePhaseT n u i e m b #

return :: a -> CompilePhaseT n u i e m a #

fail :: String -> CompilePhaseT n u i e m a #

CompileRunner state n pos loc u i e m => Functor (CompilePhaseT n u i e m) Source # 

Methods

fmap :: (a -> b) -> CompilePhaseT n u i e m a -> CompilePhaseT n u i e m b #

(<$) :: a -> CompilePhaseT n u i e m b -> CompilePhaseT n u i e m a #

CompileRunner state n pos loc u i e m => Applicative (CompilePhaseT n u i e m) Source # 

Methods

pure :: a -> CompilePhaseT n u i e m a #

(<*>) :: CompilePhaseT n u i e m (a -> b) -> CompilePhaseT n u i e m a -> CompilePhaseT n u i e m b #

liftA2 :: (a -> b -> c) -> CompilePhaseT n u i e m a -> CompilePhaseT n u i e m b -> CompilePhaseT n u i e m c #

(*>) :: CompilePhaseT n u i e m a -> CompilePhaseT n u i e m b -> CompilePhaseT n u i e m b #

(<*) :: CompilePhaseT n u i e m a -> CompilePhaseT n u i e m b -> CompilePhaseT n u i e m a #

class CompileUnit u n l s | u -> n l s where Source #

Per compile unit

Methods

cuDefault :: u Source #

cuFPath :: u -> FPath Source #

cuUpdFPath :: FPath -> u -> u Source #

cuLocation :: u -> l Source #

cuUpdLocation :: l -> u -> u Source #

cuKey :: u -> n Source #

cuUpdKey :: n -> u -> u Source #

cuState :: u -> s Source #

cuUpdState :: s -> u -> u Source #

cuImports :: u -> [n] Source #

cuParticipation :: u -> [CompileParticipation] Source #

class CompileUnitState s where Source #

State of a compile unit

Minimal complete definition

cusDefault, cusUnk, cusIsUnk, cusIsImpKnown

class FPathError e => CompileRunError e p | e -> p where Source #

Error reporting

Methods

crePPErrL :: [e] -> PP_Doc Source #

creMkNotFoundErrL :: p -> String -> [String] -> [FileSuffix] -> [e] Source #

creAreFatal :: [e] -> Bool Source #

class CompileModName n where Source #

Conversion from string to module name

Minimal complete definition

mkCMNm

Methods

mkCMNm :: String -> n Source #

class CompileRunStateInfo i n p where Source #

Minimal complete definition

crsiImportPosOfCUKey

Methods

crsiImportPosOfCUKey :: n -> i -> p Source #

class FileLocatable x loc | loc -> x where Source #

Minimal complete definition

fileLocation, noFileLocation

Methods

fileLocation :: x -> loc Source #

noFileLocation :: loc Source #

mkEmptyCompileRun :: n -> i -> CompileRun n u i e Source #

crCU :: (Show n, Ord n) => n -> CompileRun n u i e -> u Source #

crMbCU :: Ord n => n -> CompileRun n u i e -> Maybe u Source #

ppCR :: (PP n, PP u) => CompileRun n u i e -> PP_Doc Source #

cpUpdStateInfo :: (i -> i) -> CompilePhase n u i e () Source #

cpUpdSI :: (i -> i) -> CompilePhase n u i e () Source #

cpUpdCU :: (Ord n, CompileUnit u n l s) => n -> (u -> u) -> CompilePhase n u i e () Source #

cpUpdCUWithKey :: (Ord n, CompileUnit u n l s) => n -> (n -> u -> (n, u)) -> CompilePhase n u i e n Source #

cpSetErrs :: [e] -> CompilePhase n u i e () Source #

cpSetLimitErrs :: Int -> String -> [e] -> CompilePhase n u i e () Source #

cpSetLimitErrsWhen :: Int -> String -> [e] -> CompilePhase n u i e () Source #

cpSetInfos :: String -> Bool -> [e] -> CompilePhase n u i e () Source #

cpSetCompileOrder :: [[n]] -> CompilePhase n u i e () Source #

cpSeq :: CompileRunError e p => [CompilePhase n u i e ()] -> CompilePhase n u i e () Source #

cpSeqWhen :: CompileRunError e p => Bool -> [CompilePhase n u i e ()] -> CompilePhase n u i e () Source #

cpFindFilesForFPathInLocations Source #

Arguments

:: (Ord n, FPATH n, FileLocatable u loc, Show loc, CompileUnitState s, CompileRunError e p, CompileUnit u n loc s, CompileModName n, CompileRunStateInfo i n p) 
=> (loc -> n -> FPath -> [(loc, FPath, [e])])

get the locations for a name, possibly with errors

-> ((FPath, loc, [e]) -> res)

construct a result given a found location

-> Bool

stop when first is found

-> [(FileSuffix, s)]

suffix info

-> [loc]

locations to search

-> Maybe n

possibly a module name

-> Maybe FPath

possibly a file path

-> CompilePhase n u i e [res] 

cpImportGather :: (Show n, Ord n, CompileUnit u n l s, CompileRunError e p, CompileUnitState s) => (n -> CompilePhase n u i e ()) -> n -> CompilePhase n u i e () Source #

Abbreviation for cpImportGatherFromMods for 1 module

cpImportGatherFromMods :: (Show n, Ord n, CompileUnit u n l s, CompileRunError e p, CompileUnitState s) => (Maybe prev -> n -> CompilePhase n u i e (x, Maybe prev)) -> [n] -> CompilePhase n u i e () Source #

recursively extract imported modules

cpImportGatherFromModsWithImp :: (Show n, Ord n, CompileUnit u n l s, CompileRunError e p, CompileUnitState s) => (u -> [n]) -> (Maybe prev -> n -> CompilePhase n u i e (x, Maybe prev)) -> [n] -> CompilePhase n u i e () Source #

recursively extract imported modules, providing a way to import + do the import

cpPP :: (PP n, PP u) => String -> CompilePhase n u i e () Source #

cpPPMsg :: PP m => m -> CompilePhase n u i e () Source #

forgetM :: Monad m => m a -> m () Source #