Distribution.Simple.CCompiler

Cabal-3.0.1.0: A framework for packaging Haskell software

Copyright | 2011 Dan Knapp
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Simple.CCompiler

Description

This simple package provides types and functions for interacting with C compilers. Currently it's just a type enumerating extant C-like languages, which we call dialects.

Synopsis

- data CDialect
  - = C
  - | ObjectiveC
  - | CPlusPlus
  - | ObjectiveCPlusPlus
- cSourceExtensions :: [String]
- cDialectFilenameExtension :: CDialect -> Bool -> String
- filenameCDialect :: String -> Maybe (CDialect, Bool)

# Documentation

data CDialect Source #

Represents a dialect of C. The Monoid instance expresses backward compatibility, in the sense that 'mappend a b' is the least inclusive dialect which both `a` and `b` can be correctly interpreted as.

Constructors

C |
ObjectiveC |
CPlusPlus |
ObjectiveCPlusPlus |

#### Instances

Instances details

Eq CDialect # |
Instance details Defined in Distribution.Simple.CCompiler Methods (==) :: CDialect -> CDialect -> Bool # (/=) :: CDialect -> CDialect -> Bool #
Show CDialect # |
Instance details Defined in Distribution.Simple.CCompiler Methods showsPrec :: Int -> CDialect -> ShowS Source # show :: CDialect -> String Source # showList :: [CDialect] -> ShowS Source #
Semigroup CDialect # |
Instance details Defined in Distribution.Simple.CCompiler Methods (<>) :: CDialect -> CDialect -> CDialect Source # sconcat :: NonEmpty CDialect -> CDialect Source # stimes :: Integral b => b -> CDialect -> CDialect Source #
Monoid CDialect # |
Instance details Defined in Distribution.Simple.CCompiler Methods mempty :: CDialect Source # mappend :: CDialect -> CDialect -> CDialect Source # mconcat :: [CDialect] -> CDialect Source #

cSourceExtensions :: [String] Source #

A list of all file extensions which are recognized as possibly containing some dialect of C code. Note that this list is only for source files, not for header files.

cDialectFilenameExtension :: CDialect -> Bool -> String Source #

Takes a dialect of C and whether code is intended to be passed through the preprocessor, and returns a filename extension for containing that code.

filenameCDialect :: String -> Maybe (CDialect, Bool) Source #

Infers from a filename's extension the dialect of C which it contains, and whether it is intended to be passed through the preprocessor.