| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Development.Shake.ATS
Synopsis
- atsBin :: ATSTarget -> Rules ()
- cgen :: ATSToolConfig -> [FilePath] -> [FilePath] -> FilePath -> FilePattern -> Rules ()
- genATS :: FilePath -> FilePattern -> Bool -> Rules ()
- atsLex :: FilePath -> FilePattern -> Rules ()
- cabalForeign :: ForeignCabal -> Rules ()
- hsAts :: ATSGen -> Rules ()
- cleanATS :: Action ()
- getSubdirs :: FilePath -> IO [FilePath]
- ccToDir :: CCompiler -> String
- withPF :: Action (Exit, Stderr String, Stdout String) -> Action (Exit, Stderr String, Stdout String)
- patscc :: ATSToolConfig -> String
- patsopt :: ATSToolConfig -> String
- data ForeignCabal = ForeignCabal {
- projectFile :: Maybe Text
- cabalFile :: Text
- objectFile :: Text
- data ATSTarget = ATSTarget {
- _cFlags :: [String]
- _toolConfig :: ATSToolConfig
- _gc :: Bool
- _libs :: [String]
- _src :: [FilePath]
- _hsLibs :: [ForeignCabal]
- _genTargets :: [ATSGen]
- _linkTargets :: [HATSGen]
- _binTarget :: FilePath
- _otherDeps :: [FilePath]
- _tgtType :: ArtifactType
- data ATSToolConfig = ATSToolConfig {
- _patsHome :: String
- _patsHomeLocs :: String
- _hasPretty :: Bool
- _cc :: CCompiler
- _linkStatic :: Bool
- data CCompiler where
- data ArtifactType
- data ATSGen = ATSGen {}
- data HATSGen = HATSGen {}
- atsTarget :: Lens' ATSGen FilePath
- cFlags :: Lens' ATSTarget [String]
- binTarget :: Lens' ATSTarget FilePath
- cc :: Lens' ATSToolConfig CCompiler
- gc :: Lens' ATSTarget Bool
- hasPretty :: Lens' ATSToolConfig Bool
- genTargets :: Lens' ATSTarget [ATSGen]
- hsLibs :: Lens' ATSTarget [ForeignCabal]
- patsHome :: Lens' ATSToolConfig String
- patsHomeLocs :: Lens' ATSToolConfig String
- libs :: Lens' ATSTarget [String]
- linkStatic :: Lens' ATSToolConfig Bool
- linkTargets :: Lens' ATSTarget [HATSGen]
- otherDeps :: Lens' ATSTarget [FilePath]
- src :: Lens' ATSTarget [FilePath]
- tgtType :: Lens' ATSTarget ArtifactType
- toolConfig :: Lens' ATSTarget ATSToolConfig
- cpphs :: Lens' ATSGen Bool
- hsFile :: Lens' ATSGen FilePath
Shake Rules
atsBin :: ATSTarget -> Rules () Source #
Rules for generating binaries or libraries from ATS code. This is very
general; use defaultATSTarget for sensible defaults that can be modified
with the provided lenses.
Arguments
| :: ATSToolConfig | |
| -> [FilePath] | Extra files to track |
| -> [FilePath] | ATS source that may be generated. |
| -> FilePath | ATS source |
| -> FilePattern | Pattern for C file to be generated |
| -> Rules () |
Generate C code from ATS code.
Arguments
| :: FilePath | Haskell source |
| -> FilePattern |
|
| -> Bool | Whether to call cpphs preprocessor |
| -> Rules () |
Given a plain Haskell source file, generate a .sats file containing
the equivalent types.
Arguments
| :: FilePath | Filepath of |
| -> FilePattern | File pattern for generated output |
| -> Rules () |
Build a .lats file using atslex.
cabalForeign :: ForeignCabal -> Rules () Source #
These rules take a .cabal file and the .o file to be produced from
them, building the .o file.
Shake actions
Helper functions
ccToDir :: CCompiler -> String Source #
Given a C compiler, return the appropriate directory for its globally installed artifacts. This is used to keep libraries built for different platforms separate.
Arguments
| :: Action (Exit, Stderr String, Stdout String) | |
| -> Action (Exit, Stderr String, Stdout String) |
Filter any generated errors with pats-filter.
Environment/configuration
patscc :: ATSToolConfig -> String Source #
Absolute path to patscc
patsopt :: ATSToolConfig -> String Source #
Absolute path to patsopt
Types
data ForeignCabal Source #
Data type containing information about Haskell components of a build. Any functions exposed in the object file will be callable in C or ATS code.
Constructors
| ForeignCabal | |
Fields
| |
Instances
Type for binary and library builds with ATS.
Constructors
| ATSTarget | |
Fields
| |
Instances
data ATSToolConfig Source #
Information about where to find patscc and patsopt.
Constructors
| ATSToolConfig | |
Fields
| |
Instances
| Generic ATSToolConfig Source # | |
Defined in Development.Shake.ATS.Type Associated Types type Rep ATSToolConfig :: Type -> Type # | |
| Binary ATSToolConfig Source # | |
Defined in Development.Shake.ATS.Type | |
| type Rep ATSToolConfig Source # | |
Defined in Development.Shake.ATS.Type type Rep ATSToolConfig = D1 ('MetaData "ATSToolConfig" "Development.Shake.ATS.Type" "shake-ats-1.6.0.2-6U4VvL700JcGpoPjpTv6TB" 'False) (C1 ('MetaCons "ATSToolConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_patsHome") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "_patsHomeLocs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just "_hasPretty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "_cc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CCompiler) :*: S1 ('MetaSel ('Just "_linkStatic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))) | |
A data type representing the C compiler to be used.
Bundled Patterns
| pattern GHCStd :: CCompiler | Default |
| pattern GCCStd :: CCompiler | Default |
Instances
| Eq CCompiler | |
| Generic CCompiler Source # | |
| Binary CCompiler Source # | |
| type Rep CCompiler Source # | |
Defined in Development.Shake.ATS.Type type Rep CCompiler = D1 ('MetaData "CCompiler" "Development.Shake.C" "shake-ext-2.11.0.1-9k6S9xexKlZKbY1SIwBb52" 'False) ((C1 ('MetaCons "GCC" 'PrefixI 'True) (S1 ('MetaSel ('Just "_prefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String))) :+: C1 ('MetaCons "Clang" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "GHC" 'PrefixI 'True) (S1 ('MetaSel ('Just "_prefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String)) :*: S1 ('MetaSel ('Just "_postfix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String))) :+: (C1 ('MetaCons "CompCert" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Other" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))) | |
data ArtifactType Source #
Constructors
| StaticLibrary | |
| Executable | |
| SharedLibrary |
Instances
| Generic ArtifactType Source # | |
Defined in Development.Shake.ATS.Type Associated Types type Rep ArtifactType :: Type -> Type # | |
| Binary ArtifactType Source # | |
Defined in Development.Shake.ATS.Type | |
| type Rep ArtifactType Source # | |
Defined in Development.Shake.ATS.Type type Rep ArtifactType = D1 ('MetaData "ArtifactType" "Development.Shake.ATS.Type" "shake-ats-1.6.0.2-6U4VvL700JcGpoPjpTv6TB" 'False) (C1 ('MetaCons "StaticLibrary" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Executable" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SharedLibrary" 'PrefixI 'False) (U1 :: Type -> Type))) | |
Constructors
| ATSGen | |
Instances
| Generic ATSGen Source # | |
| Binary ATSGen Source # | |
| type Rep ATSGen Source # | |
Defined in Development.Shake.ATS.Type type Rep ATSGen = D1 ('MetaData "ATSGen" "Development.Shake.ATS.Type" "shake-ats-1.6.0.2-6U4VvL700JcGpoPjpTv6TB" 'False) (C1 ('MetaCons "ATSGen" 'PrefixI 'True) (S1 ('MetaSel ('Just "_hsFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "_atsTarget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "_cpphs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) | |
Constructors
| HATSGen | |
Instances
| Generic HATSGen Source # | |
| Binary HATSGen Source # | |
| type Rep HATSGen Source # | |
Defined in Development.Shake.ATS.Type type Rep HATSGen = D1 ('MetaData "HATSGen" "Development.Shake.ATS.Type" "shake-ats-1.6.0.2-6U4VvL700JcGpoPjpTv6TB" 'False) (C1 ('MetaCons "HATSGen" 'PrefixI 'True) (S1 ('MetaSel ('Just "satsFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "hatsFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))) | |