stack-1.4.0: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Types.TemplateName

Description

Template name handling.

Synopsis

- data TemplateName = TemplateName !Text !TemplatePath
- data TemplatePath
  - = AbsPath (Path Abs File)
  - | RelPath (Path Rel File)
  - | UrlPath String
- data TemplateInfo = TemplateInfo {
  - author :: Maybe Text
  - description :: Maybe Text
  }
- templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName
- templateParamArgument :: Mod OptionFields (Text, Text) -> Parser (Text, Text)
- parseTemplateNameFromString :: String -> Either String TemplateName
- mkTemplateName :: String -> Q Exp
- templateName :: TemplateName -> Text
- templatePath :: TemplateName -> TemplatePath

# Documentation

data TemplateName #

A template name.

Constructors

TemplateName !Text !TemplatePath |

Instances

Eq TemplateName # |
Methods (==) :: TemplateName -> TemplateName -> Bool # (/=) :: TemplateName -> TemplateName -> Bool #
Ord TemplateName # |
Methods compare :: TemplateName -> TemplateName -> Ordering # (<) :: TemplateName -> TemplateName -> Bool # (<=) :: TemplateName -> TemplateName -> Bool # (>) :: TemplateName -> TemplateName -> Bool # (>=) :: TemplateName -> TemplateName -> Bool # max :: TemplateName -> TemplateName -> TemplateName # min :: TemplateName -> TemplateName -> TemplateName #
Show TemplateName # |
Methods showsPrec :: Int -> TemplateName -> ShowS # show :: TemplateName -> String # showList :: [TemplateName] -> ShowS #
FromJSON TemplateName # |
Methods parseJSON :: Value -> Parser TemplateName # parseJSONList :: Value -> Parser [TemplateName] #

data TemplatePath #

Constructors

AbsPath (Path Abs File) | an absolute path on the filesystem
RelPath (Path Rel File) | a relative path on the filesystem, or relative to the template repository
UrlPath String | a full URL

Instances

Eq TemplatePath # |
Methods (==) :: TemplatePath -> TemplatePath -> Bool # (/=) :: TemplatePath -> TemplatePath -> Bool #
Ord TemplatePath # |
Methods compare :: TemplatePath -> TemplatePath -> Ordering # (<) :: TemplatePath -> TemplatePath -> Bool # (<=) :: TemplatePath -> TemplatePath -> Bool # (>) :: TemplatePath -> TemplatePath -> Bool # (>=) :: TemplatePath -> TemplatePath -> Bool # max :: TemplatePath -> TemplatePath -> TemplatePath # min :: TemplatePath -> TemplatePath -> TemplatePath #
Show TemplatePath # |
Methods showsPrec :: Int -> TemplatePath -> ShowS # show :: TemplatePath -> String # showList :: [TemplatePath] -> ShowS #

data TemplateInfo #

Constructors

TemplateInfo |
Fields author :: Maybe Text description :: Maybe Text

Instances

Eq TemplateInfo # |
Methods (==) :: TemplateInfo -> TemplateInfo -> Bool # (/=) :: TemplateInfo -> TemplateInfo -> Bool #
Ord TemplateInfo # |
Methods compare :: TemplateInfo -> TemplateInfo -> Ordering # (<) :: TemplateInfo -> TemplateInfo -> Bool # (<=) :: TemplateInfo -> TemplateInfo -> Bool # (>) :: TemplateInfo -> TemplateInfo -> Bool # (>=) :: TemplateInfo -> TemplateInfo -> Bool # max :: TemplateInfo -> TemplateInfo -> TemplateInfo # min :: TemplateInfo -> TemplateInfo -> TemplateInfo #
Show TemplateInfo # |
Methods showsPrec :: Int -> TemplateInfo -> ShowS # show :: TemplateInfo -> String # showList :: [TemplateInfo] -> ShowS #
FromJSON TemplateInfo # |
Methods parseJSON :: Value -> Parser TemplateInfo # parseJSONList :: Value -> Parser [TemplateInfo] #

templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName #

An argument which accepts a template name of the format `foo.hsfiles` or `foo`, ultimately normalized to `foo`.

templateParamArgument :: Mod OptionFields (Text, Text) -> Parser (Text, Text) #

An argument which accepts a `key:value` pair for specifying parameters.

parseTemplateNameFromString :: String -> Either String TemplateName #

Parse a template name from a string.

mkTemplateName :: String -> Q Exp #

Make a template name.

templateName :: TemplateName -> Text #

Get a text representation of the template name.

templatePath :: TemplateName -> TemplatePath #

Get the path of the template.