gf-3.7.1: Grammatical Framework

Safe HaskellSafe
LanguageHaskell2010

PGF.Haskell

Contents

Description

Auxiliary types and functions for use with grammars translated to Haskell with gf -output-format=haskell -haskell=concrete

Synopsis

Concrete syntax

class EnumAll a where Source

For enumerating parameter values used in tables

Methods

enumAll :: [a] Source

Instances

table :: (Ord k, EnumAll k) => [a] -> k -> a Source

Tables

type Str = [Tok] Source

Token sequences, output form linearization functions

data Tok Source

Tokens

type Prefix Source

Arguments

 = String

To be matched with the prefix of a following token

fromStr :: Str -> String Source

Render a token sequence as a String

Common record types

class Has_s r a | r -> a where Source

Overloaded function to project the s field from any record type

Methods

proj_s :: r -> a Source

Instances

Has_s (R_s t) t Source 

data R_s t Source

Haskell representation of the GF record type {s:t}

Constructors

R_s t 

Instances

Eq t => Eq (R_s t) Source 
Ord t => Ord (R_s t) Source 
Show t => Show (R_s t) Source 
EnumAll t => EnumAll (R_s t) Source 
Has_s (R_s t) t Source 

to_R_s :: Has_s r t => r -> R_s t Source

Coerce from any record type {...,s:t,...} field to the supertype {s:t}

Variants

(+++) :: Applicative f => f [a] -> f [a] -> f [a] infixr 5 Source

Concatenation with variants

(!) :: Monad m => (t -> m (m a)) -> t -> m a Source

Selection from tables with variants

(!$) :: Monad m => (a1 -> m a) -> m a1 -> m a Source

(!*) :: Monad m => m (a1 -> m a) -> m a1 -> m a Source