fluent-syntax
Safe HaskellTrustworthy
LanguageHaskell2010

Language.Fluent.AST

Description

The abstract syntax tree of FTL, the Project Fluent file format.

The documentation of each type links to the relevant chapter of the Fluent Syntax Guide.

The normative reference is the grammar.

Synopsis

Documentation

newtype Resource Source #

An entire FTL file

Constructors

Resource 

Fields

Instances

Instances details
Generic Resource Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Resource 
Instance details

Defined in Language.Fluent.AST

type Rep Resource = D1 ('MetaData "Resource" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "Resource" 'PrefixI 'True) (S1 ('MetaSel ('Just "entries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Entry])))

Methods

from :: Resource -> Rep Resource x #

to :: Rep Resource x -> Resource #

Show Resource Source # 
Instance details

Defined in Language.Fluent.AST

Eq Resource Source # 
Instance details

Defined in Language.Fluent.AST

Lift Resource Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Resource -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Resource -> Code m Resource #

type Rep Resource Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Resource = D1 ('MetaData "Resource" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "Resource" 'PrefixI 'True) (S1 ('MetaSel ('Just "entries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Entry])))

data Entry Source #

A top-level element of a Resource

Constructors

MessageEntry Message

A Message: hello = Hello, world!

TermEntry Term

A Term: -brand-name = Fluent

CommentEntry Comment

A standalone # comment, not attached to a Message or Term.

GroupCommentEntry Comment

A ## comment, describing the group of entries that follows it.

ResourceCommentEntry Comment

A ### comment, describing the whole Resource.

JunkEntry Text

Source text which could not be parsed, preserved verbatim. See the guide on error recovery.

Instances

Instances details
Generic Entry Source # 
Instance details

Defined in Language.Fluent.AST

Methods

from :: Entry -> Rep Entry x #

to :: Rep Entry x -> Entry #

Show Entry Source # 
Instance details

Defined in Language.Fluent.AST

Methods

showsPrec :: Int -> Entry -> ShowS #

show :: Entry -> String #

showList :: [Entry] -> ShowS #

Eq Entry Source # 
Instance details

Defined in Language.Fluent.AST

Methods

(==) :: Entry -> Entry -> Bool #

(/=) :: Entry -> Entry -> Bool #

Lift Entry Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Entry -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Entry -> Code m Entry #

type Rep Entry Source # 
Instance details

Defined in Language.Fluent.AST

data Message Source #

A translation unit. Either the value or the attributes must be present.

Constructors

Message 

Fields

Instances

Instances details
Generic Message Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Message 
Instance details

Defined in Language.Fluent.AST

type Rep Message = D1 ('MetaData "Message" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Message" 'PrefixI 'True) ((S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Pattern))) :*: (S1 ('MetaSel ('Just "attributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Attribute]) :*: S1 ('MetaSel ('Just "comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Comment)))))

Methods

from :: Message -> Rep Message x #

to :: Rep Message x -> Message #

Show Message Source # 
Instance details

Defined in Language.Fluent.AST

Eq Message Source # 
Instance details

Defined in Language.Fluent.AST

Methods

(==) :: Message -> Message -> Bool #

(/=) :: Message -> Message -> Bool #

Lift Message Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Message -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Message -> Code m Message #

type Rep Message Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Message = D1 ('MetaData "Message" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Message" 'PrefixI 'True) ((S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Pattern))) :*: (S1 ('MetaSel ('Just "attributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Attribute]) :*: S1 ('MetaSel ('Just "comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Comment)))))

data Term Source #

A translation unit which is only ever referenced by other translations. See Terms.

Constructors

Term 

Fields

  • id :: Identifier

    The name by which the term is referenced, without the leading -. e.g. brand-name in -brand-name.

  • value :: Pattern

    The translation itself; unlike a Message, a term always has one.

  • attributes :: [Attribute]

    Additional translations belonging to this term, often grammatical properties such as gender or case.

  • comment :: Maybe Comment

    The # comment directly above the term, if any.

Instances

Instances details
Generic Term Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Term 
Instance details

Defined in Language.Fluent.AST

Methods

from :: Term -> Rep Term x #

to :: Rep Term x -> Term #

Show Term Source # 
Instance details

Defined in Language.Fluent.AST

Methods

showsPrec :: Int -> Term -> ShowS #

show :: Term -> String #

showList :: [Term] -> ShowS #

Eq Term Source # 
Instance details

Defined in Language.Fluent.AST

Methods

(==) :: Term -> Term -> Bool #

(/=) :: Term -> Term -> Bool #

Lift Term Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Term -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Term -> Code m Term #

type Rep Term Source # 
Instance details

Defined in Language.Fluent.AST

newtype Comment Source #

The text of a comment, with the # prefixes and the space following them removed. See Comments.

Constructors

Comment Text 

Instances

Instances details
Generic Comment Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Comment 
Instance details

Defined in Language.Fluent.AST

type Rep Comment = D1 ('MetaData "Comment" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "Comment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: Comment -> Rep Comment x #

to :: Rep Comment x -> Comment #

Show Comment Source # 
Instance details

Defined in Language.Fluent.AST

Eq Comment Source # 
Instance details

Defined in Language.Fluent.AST

Methods

(==) :: Comment -> Comment -> Bool #

(/=) :: Comment -> Comment -> Bool #

Lift Comment Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Comment -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Comment -> Code m Comment #

type Rep Comment Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Comment = D1 ('MetaData "Comment" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "Comment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Attribute Source #

A named Pattern belonging to a Message or a Term, written as .key = value on a line of its own. See Attributes.

Instances

Instances details
Generic Attribute Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Attribute 
Instance details

Defined in Language.Fluent.AST

type Rep Attribute = D1 ('MetaData "Attribute" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Attribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pattern)))
Show Attribute Source # 
Instance details

Defined in Language.Fluent.AST

Eq Attribute Source # 
Instance details

Defined in Language.Fluent.AST

Lift Attribute Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Attribute -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Attribute -> Code m Attribute #

type Rep Attribute Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Attribute = D1 ('MetaData "Attribute" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Attribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pattern)))

newtype Pattern Source #

The value of a Message, Term, Attribute or Variant: text interspersed with placeables. See Writing Text.

Instances

Instances details
Generic Pattern Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Pattern 
Instance details

Defined in Language.Fluent.AST

type Rep Pattern = D1 ('MetaData "Pattern" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "Pattern" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty PatternElement))))

Methods

from :: Pattern -> Rep Pattern x #

to :: Rep Pattern x -> Pattern #

Show Pattern Source # 
Instance details

Defined in Language.Fluent.AST

Eq Pattern Source # 
Instance details

Defined in Language.Fluent.AST

Methods

(==) :: Pattern -> Pattern -> Bool #

(/=) :: Pattern -> Pattern -> Bool #

Lift Pattern Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Pattern -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Pattern -> Code m Pattern #

type Rep Pattern Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Pattern = D1 ('MetaData "Pattern" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "Pattern" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty PatternElement))))

data PatternElement Source #

A single piece of a Pattern.

Constructors

InlineText Text

Text on the first line of the pattern, or following a Placeable.

BlockText Text

Text on a continuation line, already dedented according to the multiline rules.

Placeable Placeable 

Instances

Instances details
Generic PatternElement Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep PatternElement 
Instance details

Defined in Language.Fluent.AST

type Rep PatternElement = D1 ('MetaData "PatternElement" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "InlineText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "BlockText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "Placeable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Placeable))))
Show PatternElement Source # 
Instance details

Defined in Language.Fluent.AST

Eq PatternElement Source # 
Instance details

Defined in Language.Fluent.AST

Lift PatternElement Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => PatternElement -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => PatternElement -> Code m PatternElement #

type Rep PatternElement Source # 
Instance details

Defined in Language.Fluent.AST

type Rep PatternElement = D1 ('MetaData "PatternElement" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "InlineText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "BlockText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "Placeable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Placeable))))

data Placeable Source #

An Expression embedded in a Pattern between braces, e.g. { $userName }. See Placeables.

Constructors

InlinePlaceable Expression

A placeable on the same line as the text preceding it.

BlockPlaceable Int Expression

A placeable on a continuation line, together with its indentation in columns, which takes part in computing the common indent of the Pattern.

Instances

Instances details
Generic Placeable Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Placeable 
Instance details

Defined in Language.Fluent.AST

type Rep Placeable = D1 ('MetaData "Placeable" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "InlinePlaceable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expression)) :+: C1 ('MetaCons "BlockPlaceable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expression)))
Show Placeable Source # 
Instance details

Defined in Language.Fluent.AST

Eq Placeable Source # 
Instance details

Defined in Language.Fluent.AST

Lift Placeable Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Placeable -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Placeable -> Code m Placeable #

type Rep Placeable Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Placeable = D1 ('MetaData "Placeable" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "InlinePlaceable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expression)) :+: C1 ('MetaCons "BlockPlaceable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expression)))

placeableExpression :: Placeable -> Expression Source #

The Expression of a Placeable, whether inline or block.

data SelectExpression Source #

A choice between several Variants, made by matching the selector, an InlineExpression, against the VariantKeys: { $count -> ... }. See Selectors.

Instances

Instances details
Generic SelectExpression Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep SelectExpression 
Instance details

Defined in Language.Fluent.AST

type Rep SelectExpression = D1 ('MetaData "SelectExpression" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "SelectExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineExpression) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VariantList)))
Show SelectExpression Source # 
Instance details

Defined in Language.Fluent.AST

Eq SelectExpression Source # 
Instance details

Defined in Language.Fluent.AST

Lift SelectExpression Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => SelectExpression -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => SelectExpression -> Code m SelectExpression #

type Rep SelectExpression Source # 
Instance details

Defined in Language.Fluent.AST

type Rep SelectExpression = D1 ('MetaData "SelectExpression" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "SelectExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineExpression) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VariantList)))

data InlineExpression Source #

An expression which yields a value.

Constructors

StringLiteralExpression StringLiteral 
NumberLiteralExpression NumberLiteral 
FunctionReference Identifier CallArguments

A call of a built-in or implementation-provided function, e.g. NUMBER($ratio, minimumFractionDigits: 2). See Built-in Functions and Functions.

MessageReference Identifier (Maybe AttributeAccessor)

A reference to another Message or one of its attributes. See Referencing Messages.

TermReference Identifier (Maybe AttributeAccessor) (Maybe CallArguments)

A reference to a Term or one of its attributes, with optional arguments to parameterise it. See Terms.

VariableReference Identifier

A reference to an argument passed in by the application, e.g. $userName. See Variables.

PlaceableExpression Expression

A placeable nested inside another placeable, used for grouping.

Instances

Instances details
Generic InlineExpression Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep InlineExpression 
Instance details

Defined in Language.Fluent.AST

type Rep InlineExpression = D1 ('MetaData "InlineExpression" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) ((C1 ('MetaCons "StringLiteralExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StringLiteral)) :+: (C1 ('MetaCons "NumberLiteralExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NumberLiteral)) :+: C1 ('MetaCons "FunctionReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CallArguments)))) :+: ((C1 ('MetaCons "MessageReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AttributeAccessor))) :+: C1 ('MetaCons "TermReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AttributeAccessor)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CallArguments))))) :+: (C1 ('MetaCons "VariableReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier)) :+: C1 ('MetaCons "PlaceableExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expression)))))
Show InlineExpression Source # 
Instance details

Defined in Language.Fluent.AST

Eq InlineExpression Source # 
Instance details

Defined in Language.Fluent.AST

Lift InlineExpression Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => InlineExpression -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => InlineExpression -> Code m InlineExpression #

type Rep InlineExpression Source # 
Instance details

Defined in Language.Fluent.AST

type Rep InlineExpression = D1 ('MetaData "InlineExpression" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) ((C1 ('MetaCons "StringLiteralExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StringLiteral)) :+: (C1 ('MetaCons "NumberLiteralExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NumberLiteral)) :+: C1 ('MetaCons "FunctionReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CallArguments)))) :+: ((C1 ('MetaCons "MessageReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AttributeAccessor))) :+: C1 ('MetaCons "TermReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AttributeAccessor)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CallArguments))))) :+: (C1 ('MetaCons "VariableReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier)) :+: C1 ('MetaCons "PlaceableExpression" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Expression)))))

newtype AttributeAccessor Source #

The .key suffix of a reference, selecting an Attribute of the referent. See Attributes.

Instances

Instances details
Generic AttributeAccessor Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep AttributeAccessor 
Instance details

Defined in Language.Fluent.AST

type Rep AttributeAccessor = D1 ('MetaData "AttributeAccessor" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "AttributeAccessor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier)))
Show AttributeAccessor Source # 
Instance details

Defined in Language.Fluent.AST

Eq AttributeAccessor Source # 
Instance details

Defined in Language.Fluent.AST

Lift AttributeAccessor Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => AttributeAccessor -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => AttributeAccessor -> Code m AttributeAccessor #

type Rep AttributeAccessor Source # 
Instance details

Defined in Language.Fluent.AST

type Rep AttributeAccessor = D1 ('MetaData "AttributeAccessor" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "AttributeAccessor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier)))

data Expression Source #

The contents of a Placeable. See Placeables.

Instances

Instances details
Generic Expression Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Expression 
Instance details

Defined in Language.Fluent.AST

type Rep Expression = D1 ('MetaData "Expression" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Select" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SelectExpression)) :+: C1 ('MetaCons "Inline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineExpression)))
Show Expression Source # 
Instance details

Defined in Language.Fluent.AST

Eq Expression Source # 
Instance details

Defined in Language.Fluent.AST

Lift Expression Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Expression -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Expression -> Code m Expression #

type Rep Expression Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Expression = D1 ('MetaData "Expression" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Select" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SelectExpression)) :+: C1 ('MetaCons "Inline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InlineExpression)))

data Variant Source #

One branch of a SelectExpression, written as [key] value on a line of its own. See Selectors.

Constructors

Variant 

Fields

  • key :: VariantKey

    The value or plural category.

  • value :: Pattern

    The translation for this variant.

  • isDefault :: Bool

    Whether the variant is marked as default with *. A default variant is used when no key matches.

Instances

Instances details
Generic Variant Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep Variant 
Instance details

Defined in Language.Fluent.AST

type Rep Variant = D1 ('MetaData "Variant" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Variant" 'PrefixI 'True) (S1 ('MetaSel ('Just "key") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VariantKey) :*: (S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pattern) :*: S1 ('MetaSel ('Just "isDefault") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

Methods

from :: Variant -> Rep Variant x #

to :: Rep Variant x -> Variant #

Show Variant Source # 
Instance details

Defined in Language.Fluent.AST

Eq Variant Source # 
Instance details

Defined in Language.Fluent.AST

Methods

(==) :: Variant -> Variant -> Bool #

(/=) :: Variant -> Variant -> Bool #

Lift Variant Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Variant -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Variant -> Code m Variant #

type Rep Variant Source # 
Instance details

Defined in Language.Fluent.AST

type Rep Variant = D1 ('MetaData "Variant" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "Variant" 'PrefixI 'True) (S1 ('MetaSel ('Just "key") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VariantKey) :*: (S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pattern) :*: S1 ('MetaSel ('Just "isDefault") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

newtype VariantKey Source #

The key of a Variant: either a number, or a plural category such as one or other. See Selectors.

Instances

Instances details
Generic VariantKey Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep VariantKey 
Instance details

Defined in Language.Fluent.AST

type Rep VariantKey = D1 ('MetaData "VariantKey" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "VariantKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either NumberLiteral Identifier))))
Show VariantKey Source # 
Instance details

Defined in Language.Fluent.AST

Eq VariantKey Source # 
Instance details

Defined in Language.Fluent.AST

Lift VariantKey Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => VariantKey -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => VariantKey -> Code m VariantKey #

type Rep VariantKey Source # 
Instance details

Defined in Language.Fluent.AST

type Rep VariantKey = D1 ('MetaData "VariantKey" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "VariantKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either NumberLiteral Identifier))))

newtype VariantList Source #

The Variants of a SelectExpression. Exactly one of them is the default. See Selectors.

Constructors

VariantList (NonEmpty Variant) 

Instances

Instances details
Generic VariantList Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep VariantList 
Instance details

Defined in Language.Fluent.AST

type Rep VariantList = D1 ('MetaData "VariantList" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "VariantList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Variant))))
Show VariantList Source # 
Instance details

Defined in Language.Fluent.AST

Eq VariantList Source # 
Instance details

Defined in Language.Fluent.AST

Lift VariantList Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => VariantList -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => VariantList -> Code m VariantList #

type Rep VariantList Source # 
Instance details

Defined in Language.Fluent.AST

type Rep VariantList = D1 ('MetaData "VariantList" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "VariantList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Variant))))

newtype CallArguments Source #

The parenthesised arguments of a FunctionReference or TermReference. Positional arguments must precede named ones. See Functions.

Instances

Instances details
Generic CallArguments Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep CallArguments 
Instance details

Defined in Language.Fluent.AST

type Rep CallArguments = D1 ('MetaData "CallArguments" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "CallArguments" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Either NamedArgument InlineExpression])))
Show CallArguments Source # 
Instance details

Defined in Language.Fluent.AST

Eq CallArguments Source # 
Instance details

Defined in Language.Fluent.AST

Lift CallArguments Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => CallArguments -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => CallArguments -> Code m CallArguments #

type Rep CallArguments Source # 
Instance details

Defined in Language.Fluent.AST

type Rep CallArguments = D1 ('MetaData "CallArguments" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "CallArguments" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Either NamedArgument InlineExpression])))

data NamedArgument Source #

An argument passed by name, e.g. minimumFractionDigits: 2. See Functions.

Instances

Instances details
Generic NamedArgument Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep NamedArgument 
Instance details

Defined in Language.Fluent.AST

type Rep NamedArgument = D1 ('MetaData "NamedArgument" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "NamedArgument" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either StringLiteral NumberLiteral))))
Show NamedArgument Source # 
Instance details

Defined in Language.Fluent.AST

Eq NamedArgument Source # 
Instance details

Defined in Language.Fluent.AST

Lift NamedArgument Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => NamedArgument -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => NamedArgument -> Code m NamedArgument #

type Rep NamedArgument Source # 
Instance details

Defined in Language.Fluent.AST

type Rep NamedArgument = D1 ('MetaData "NamedArgument" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "NamedArgument" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either StringLiteral NumberLiteral))))

newtype Identifier Source #

The name of a Message, Term, Attribute, variable, function, or named argument.

Constructors

Identifier Text 

Instances

Instances details
Show Identifier Source # 
Instance details

Defined in Language.Fluent.AST

Eq Identifier Source # 
Instance details

Defined in Language.Fluent.AST

Ord Identifier Source # 
Instance details

Defined in Language.Fluent.AST

Hashable Identifier Source # 
Instance details

Defined in Language.Fluent.AST

Lift Identifier Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => Identifier -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Identifier -> Code m Identifier #

newtype NumberLiteral Source #

A decimal number with arbitrary precision.

Constructors

NumberLiteral Text 

Instances

Instances details
Generic NumberLiteral Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep NumberLiteral 
Instance details

Defined in Language.Fluent.AST

type Rep NumberLiteral = D1 ('MetaData "NumberLiteral" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "NumberLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show NumberLiteral Source # 
Instance details

Defined in Language.Fluent.AST

Eq NumberLiteral Source # 
Instance details

Defined in Language.Fluent.AST

Lift NumberLiteral Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => NumberLiteral -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => NumberLiteral -> Code m NumberLiteral #

type Rep NumberLiteral Source # 
Instance details

Defined in Language.Fluent.AST

type Rep NumberLiteral = D1 ('MetaData "NumberLiteral" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'True) (C1 ('MetaCons "NumberLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data StringLiteral Source #

A quoted string, used to write characters which are otherwise special in FTL.

Constructors

StringLiteral 

Fields

  • raw :: Text

    The source text between the quotes, with escape sequences unresolved.

  • value :: Text

    The text the literal denotes, with escape sequences resolved.

Instances

Instances details
Generic StringLiteral Source # 
Instance details

Defined in Language.Fluent.AST

Associated Types

type Rep StringLiteral 
Instance details

Defined in Language.Fluent.AST

type Rep StringLiteral = D1 ('MetaData "StringLiteral" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "StringLiteral" 'PrefixI 'True) (S1 ('MetaSel ('Just "raw") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show StringLiteral Source # 
Instance details

Defined in Language.Fluent.AST

Eq StringLiteral Source # 
Instance details

Defined in Language.Fluent.AST

Lift StringLiteral Source # 
Instance details

Defined in Language.Fluent.TH

Methods

lift :: Quote m => StringLiteral -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => StringLiteral -> Code m StringLiteral #

type Rep StringLiteral Source # 
Instance details

Defined in Language.Fluent.AST

type Rep StringLiteral = D1 ('MetaData "StringLiteral" "Language.Fluent.AST" "fluent-syntax-1.0.0-7BgVkF4w5nsLx3MmJftb3I" 'False) (C1 ('MetaCons "StringLiteral" 'PrefixI 'True) (S1 ('MetaSel ('Just "raw") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))