{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, GADTs, DataKinds, InstanceSigs, KindSignatures,
             MultiParamTypeClasses, UndecidableInstances,
             ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TypeFamilies #-}
{-# OPTIONS_GHC -Wno-simplifiable-class-constraints #-}

-- | Concrete data types for Modula-2 constructs that make up its Abstract Syntax Tree. Every data type from this
-- module is an instance of a type family declared in "Language.Modula2.Abstract". This way it can be replaced by
-- another data type for another language while leaving other types to be reused.

module Language.Modula2.AST (module Language.Modula2.AST,
                             Abstract.Ident,
                             Oberon.Value(..), Oberon.Element(..),
                             Oberon.FormalParameters(..), Oberon.FPSection(..),
                             Oberon.Block(..), Oberon.StatementSequence(..),
                             Oberon.Case(..), Oberon.CaseLabels(..), Oberon.ConditionalBranch(..),
                             Oberon.RelOp(..)) where

import Control.Applicative (ZipList(ZipList, getZipList))
import Control.Monad (forM, mapM)
import Data.Coerce (coerce)
import Data.Data (Data, Typeable)
import Data.List.NonEmpty
import Data.Text (Text)

import qualified Transformation.Shallow.TH
import qualified Transformation.Deep.TH
import qualified Rank2 as Rank2
import qualified Rank2.TH

import qualified Language.Modula2.Abstract as Abstract
import Language.Modula2.Abstract (Ident)
import qualified Language.Oberon.AST as Oberon

-- | Data type representing the Modula-2 language, as originally specified by ''Report on the Programming Language
-- Modula-2''.
data Language = Language deriving (Typeable Language
DataType
Constr
Typeable Language
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Language -> c Language)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Language)
-> (Language -> Constr)
-> (Language -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Language))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Language))
-> ((forall b. Data b => b -> b) -> Language -> Language)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Language -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Language -> r)
-> (forall u. (forall d. Data d => d -> u) -> Language -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Language -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Language -> m Language)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Language -> m Language)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Language -> m Language)
-> Data Language
Language -> DataType
Language -> Constr
(forall b. Data b => b -> b) -> Language -> Language
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Language -> c Language
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Language
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Language -> u
forall u. (forall d. Data d => d -> u) -> Language -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Language -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Language -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Language -> m Language
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Language -> m Language
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Language
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Language -> c Language
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Language)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Language)
$cLanguage :: Constr
$tLanguage :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Language -> m Language
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Language -> m Language
gmapMp :: (forall d. Data d => d -> m d) -> Language -> m Language
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Language -> m Language
gmapM :: (forall d. Data d => d -> m d) -> Language -> m Language
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Language -> m Language
gmapQi :: Int -> (forall d. Data d => d -> u) -> Language -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Language -> u
gmapQ :: (forall d. Data d => d -> u) -> Language -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Language -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Language -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Language -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Language -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Language -> r
gmapT :: (forall b. Data b => b -> b) -> Language -> Language
$cgmapT :: (forall b. Data b => b -> b) -> Language -> Language
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Language)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Language)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Language)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Language)
dataTypeOf :: Language -> DataType
$cdataTypeOf :: Language -> DataType
toConstr :: Language -> Constr
$ctoConstr :: Language -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Language
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Language
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Language -> c Language
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Language -> c Language
$cp1Data :: Typeable Language
Data, Typeable)

instance Abstract.Wirthy Language where
   type Module Language = Module Language
   type Declaration Language = Declaration True Language
   type Type Language = Type Language
   type Statement Language = Statement Language
   type Expression Language = Expression Language
   type Value Language = Oberon.Value Language
   type Designator Language = Designator Language

   type Import Language = Import Language
   type FieldList Language = FieldList Language
   type ProcedureHeading Language = ProcedureHeading Language
   type FormalParameters Language = Oberon.FormalParameters Language
   type FPSection Language = Oberon.FPSection Language
   type Block Language = Oberon.Block Language
   type StatementSequence Language = Oberon.StatementSequence Language
   type Case Language = Oberon.Case Language
   type CaseLabels Language = Oberon.CaseLabels Language
   type ConditionalBranch Language = Oberon.ConditionalBranch Language
   type Element Language = Oberon.Element Language

   type IdentDef Language = IdentDef Language
   type QualIdent Language = QualIdent Language

   -- Declaration
   constantDeclaration :: IdentDef l'
-> f (ConstExpression l' l' f' f') -> Declaration Language l' f' f
constantDeclaration = IdentDef l'
-> f (ConstExpression l' l' f' f') -> Declaration Language l' f' f
forall l (f :: * -> *) (f' :: * -> *) (x :: Bool) λ.
IdentDef l
-> f (ConstExpression l l f' f') -> Declaration x λ l f' f
ConstantDeclaration
   typeDeclaration :: IdentDef l' -> f (Type l' l' f' f') -> Declaration Language l' f' f
typeDeclaration = IdentDef l' -> f (Type l' l' f' f') -> Declaration Language l' f' f
forall l (f :: * -> *) (f' :: * -> *) (x :: Bool) λ.
IdentDef l -> f (Type l l f' f') -> Declaration x λ l f' f
TypeDeclaration
   variableDeclaration :: IdentList l'
-> f (Type l' l' f' f') -> Declaration Language l' f' f
variableDeclaration = IdentList l'
-> f (Type l' l' f' f') -> Declaration Language l' f' f
forall l (f :: * -> *) (f' :: * -> *) (x :: Bool) λ.
IdentList l -> f (Type l l f' f') -> Declaration x λ l f' f
VariableDeclaration
   procedureDeclaration :: f (ProcedureHeading l' l' f' f')
-> f (Block l' l' f' f') -> Declaration Language l' f' f
procedureDeclaration = f (ProcedureHeading l' l' f' f')
-> f (Block l' l' f' f') -> Declaration Language l' f' f
forall (f :: * -> *) l (f' :: * -> *) λ.
f (ProcedureHeading l l f' f')
-> f (Block l l f' f') -> Declaration 'True λ l f' f
ProcedureDeclaration

   formalParameters :: [f (FPSection l' l' f' f')]
-> Maybe (ReturnType l') -> FormalParameters Language l' f' f
formalParameters = ZipList (f (FPSection l' l' f' f'))
-> Maybe (ReturnType l') -> FormalParameters Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
ZipList (f (FPSection l l f' f'))
-> Maybe (ReturnType l) -> FormalParameters λ l f' f
Oberon.FormalParameters (ZipList (f (FPSection l' l' f' f'))
 -> Maybe (ReturnType l') -> FormalParameters Language l' f' f)
-> ([f (FPSection l' l' f' f')]
    -> ZipList (f (FPSection l' l' f' f')))
-> [f (FPSection l' l' f' f')]
-> Maybe (ReturnType l')
-> FormalParameters Language l' f' f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [f (FPSection l' l' f' f')] -> ZipList (f (FPSection l' l' f' f'))
forall a. [a] -> ZipList a
ZipList
   fpSection :: Bool
-> [Ident] -> f (Type l' l' f' f') -> FPSection Language l' f' f
fpSection = Bool
-> [Ident] -> f (Type l' l' f' f') -> FPSection Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Bool -> [Ident] -> f (Type l l f' f') -> FPSection λ l f' f
Oberon.FPSection
   block :: [f (Declaration l' l' f' f')]
-> Maybe (f (StatementSequence l' l' f' f'))
-> Block Language l' f' f
block = ZipList (f (Declaration l' l' f' f'))
-> Maybe (f (StatementSequence l' l' f' f'))
-> Block Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
ZipList (f (Declaration l l f' f'))
-> Maybe (f (StatementSequence l l f' f')) -> Block λ l f' f
Oberon.Block (ZipList (f (Declaration l' l' f' f'))
 -> Maybe (f (StatementSequence l' l' f' f'))
 -> Block Language l' f' f)
-> ([f (Declaration l' l' f' f')]
    -> ZipList (f (Declaration l' l' f' f')))
-> [f (Declaration l' l' f' f')]
-> Maybe (f (StatementSequence l' l' f' f'))
-> Block Language l' f' f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [f (Declaration l' l' f' f')]
-> ZipList (f (Declaration l' l' f' f'))
forall a. [a] -> ZipList a
ZipList
   
   fieldList :: NonEmpty (IdentDef l')
-> f (Type l' l' f' f') -> FieldList Language l' f' f
fieldList = NonEmpty (IdentDef l')
-> f (Type l' l' f' f') -> FieldList Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
IdentList l -> f (Type l l f' f') -> FieldList λ l f' f
FieldList

   -- Type
   pointerType :: f (Type l' l' f' f') -> Type Language l' f' f
pointerType = f (Type l' l' f' f') -> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Type l l f' f') -> Type λ l f' f
PointerType
   procedureType :: Maybe (f (FormalParameters l' l' f' f')) -> Type Language l' f' f
procedureType = Maybe (f (FormalParameters l' l' f' f')) -> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Maybe (f (FormalParameters l l f' f')) -> Type λ l f' f
ProcedureType
   typeReference :: QualIdent l' -> Type Language l' f' f
typeReference = QualIdent l' -> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
QualIdent l -> Type λ l f' f
TypeReference

   -- Statement
   assignment :: f (Designator l' l' f' f')
-> f (Expression l' l' f' f') -> Statement Language l' f' f
assignment = f (Designator l' l' f' f')
-> f (Expression l' l' f' f') -> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f')
-> f (Expression l l f' f') -> Statement λ l f' f
Assignment
   caseStatement :: f (Expression l' l' f' f')
-> [f (Case l' l' f' f')]
-> Maybe (f (StatementSequence l' l' f' f'))
-> Statement Language l' f' f
caseStatement f (Expression l' l' f' f')
scrutinee [f (Case l' l' f' f')]
cases = f (Expression l' l' f' f')
-> ZipList (f (Case l' l' f' f'))
-> Maybe (f (StatementSequence l' l' f' f'))
-> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> ZipList (f (Case l l f' f'))
-> Maybe (f (StatementSequence l l f' f'))
-> Statement λ l f' f
CaseStatement f (Expression l' l' f' f')
scrutinee ([f (Case l' l' f' f')] -> ZipList (f (Case l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (Case l' l' f' f')]
cases)
   emptyStatement :: Statement Language l' f' f
emptyStatement = Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Statement λ l f' f
EmptyStatement
   exitStatement :: Statement Language l' f' f
exitStatement = Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Statement λ l f' f
Exit
   ifStatement :: NonEmpty (f (ConditionalBranch l' l' f' f'))
-> Maybe (f (StatementSequence l' l' f' f'))
-> Statement Language l' f' f
ifStatement (f (ConditionalBranch l' l' f' f')
branch :| [f (ConditionalBranch l' l' f' f')]
branches) = f (ConditionalBranch l' l' f' f')
-> ZipList (f (ConditionalBranch l' l' f' f'))
-> Maybe (f (StatementSequence l' l' f' f'))
-> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (ConditionalBranch l l f' f')
-> ZipList (f (ConditionalBranch l l f' f'))
-> Maybe (f (StatementSequence l l f' f'))
-> Statement λ l f' f
If f (ConditionalBranch l' l' f' f')
branch ([f (ConditionalBranch l' l' f' f')]
-> ZipList (f (ConditionalBranch l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (ConditionalBranch l' l' f' f')]
branches)
   loopStatement :: f (StatementSequence l' l' f' f') -> Statement Language l' f' f
loopStatement = f (StatementSequence l' l' f' f') -> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (StatementSequence l l f' f') -> Statement λ l f' f
Loop
   procedureCall :: f (Designator l' l' f' f')
-> Maybe [f (Expression l' l' f' f')] -> Statement Language l' f' f
procedureCall f (Designator l' l' f' f')
proc Maybe [f (Expression l' l' f' f')]
args = f (Designator l' l' f' f')
-> Maybe (ZipList (f (Expression l' l' f' f')))
-> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f')
-> Maybe (ZipList (f (Expression l l f' f'))) -> Statement λ l f' f
ProcedureCall f (Designator l' l' f' f')
proc ([f (Expression l' l' f' f')]
-> ZipList (f (Expression l' l' f' f'))
forall a. [a] -> ZipList a
ZipList ([f (Expression l' l' f' f')]
 -> ZipList (f (Expression l' l' f' f')))
-> Maybe [f (Expression l' l' f' f')]
-> Maybe (ZipList (f (Expression l' l' f' f')))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe [f (Expression l' l' f' f')]
args)
   repeatStatement :: f (StatementSequence l' l' f' f')
-> f (Expression l' l' f' f') -> Statement Language l' f' f
repeatStatement = f (StatementSequence l' l' f' f')
-> f (Expression l' l' f' f') -> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (StatementSequence l l f' f')
-> f (Expression l l f' f') -> Statement λ l f' f
Repeat
   returnStatement :: Maybe (f (Expression l' l' f' f')) -> Statement Language l' f' f
returnStatement = Maybe (f (Expression l' l' f' f')) -> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Maybe (f (Expression l l f' f')) -> Statement λ l f' f
Return
   whileStatement :: f (Expression l' l' f' f')
-> f (StatementSequence l' l' f' f') -> Statement Language l' f' f
whileStatement = f (Expression l' l' f' f')
-> f (StatementSequence l' l' f' f') -> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (StatementSequence l l f' f') -> Statement λ l f' f
While

   conditionalBranch :: f (Expression l' l' f' f')
-> f (StatementSequence l' l' f' f')
-> ConditionalBranch Language l' f' f
conditionalBranch = f (Expression l' l' f' f')
-> f (StatementSequence l' l' f' f')
-> ConditionalBranch Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (StatementSequence l l f' f') -> ConditionalBranch λ l f' f
Oberon.ConditionalBranch
   caseAlternative :: NonEmpty (f (CaseLabels l' l' f' f'))
-> f (StatementSequence l' l' f' f') -> Case Language l' f' f
caseAlternative (f (CaseLabels l' l' f' f')
c :| [f (CaseLabels l' l' f' f')]
cs) = f (CaseLabels l' l' f' f')
-> ZipList (f (CaseLabels l' l' f' f'))
-> f (StatementSequence l' l' f' f')
-> Case Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (CaseLabels l l f' f')
-> ZipList (f (CaseLabels l l f' f'))
-> f (StatementSequence l l f' f')
-> Case λ l f' f
Oberon.Case f (CaseLabels l' l' f' f')
c ([f (CaseLabels l' l' f' f')]
-> ZipList (f (CaseLabels l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (CaseLabels l' l' f' f')]
cs)
   labelRange :: f (ConstExpression l' l' f' f')
-> f (ConstExpression l' l' f' f') -> CaseLabels Language l' f' f
labelRange = f (ConstExpression l' l' f' f')
-> f (ConstExpression l' l' f' f') -> CaseLabels Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (ConstExpression l l f' f')
-> f (ConstExpression l l f' f') -> CaseLabels λ l f' f
Oberon.LabelRange
   singleLabel :: f (ConstExpression l' l' f' f') -> CaseLabels Language l' f' f
singleLabel = f (ConstExpression l' l' f' f') -> CaseLabels Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (ConstExpression l l f' f') -> CaseLabels λ l f' f
Oberon.SingleLabel
   
   statementSequence :: [f (Statement l' l' f' f')] -> StatementSequence Language l' f' f
statementSequence = ZipList (f (Statement l' l' f' f'))
-> StatementSequence Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
ZipList (f (Statement l l f' f')) -> StatementSequence λ l f' f
Oberon.StatementSequence (ZipList (f (Statement l' l' f' f'))
 -> StatementSequence Language l' f' f)
-> ([f (Statement l' l' f' f')]
    -> ZipList (f (Statement l' l' f' f')))
-> [f (Statement l' l' f' f')]
-> StatementSequence Language l' f' f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [f (Statement l' l' f' f')] -> ZipList (f (Statement l' l' f' f'))
forall a. [a] -> ZipList a
ZipList

   -- Expression
   add :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
add = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
Add
   subtract :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
subtract = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
Subtract
   and :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
and = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
And
   or :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
or = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
Or
   divide :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
divide = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
Divide
   integerDivide :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
integerDivide = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
IntegerDivide
   literal :: f (Value l' l' f' f') -> Expression Language l' f' f
literal = f (Value l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Value l l f' f') -> Expression λ l f' f
Literal
   modulo :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
modulo = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
Modulo
   multiply :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
multiply = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Expression λ l f' f
Multiply
   functionCall :: f (Designator l' l' f' f')
-> [f (Expression l' l' f' f')] -> Expression Language l' f' f
functionCall f (Designator l' l' f' f')
fun [f (Expression l' l' f' f')]
args = f (Designator l' l' f' f')
-> ZipList (f (Expression l' l' f' f'))
-> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f')
-> ZipList (f (Expression l l f' f')) -> Expression λ l f' f
FunctionCall f (Designator l' l' f' f')
fun ([f (Expression l' l' f' f')]
-> ZipList (f (Expression l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (Expression l' l' f' f')]
args)
   negative :: f (Expression l' l' f' f') -> Expression Language l' f' f
negative = f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f') -> Expression λ l f' f
Negative
   positive :: f (Expression l' l' f' f') -> Expression Language l' f' f
positive = f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f') -> Expression λ l f' f
Positive
   not :: f (Expression l' l' f' f') -> Expression Language l' f' f
not = f (Expression l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f') -> Expression λ l f' f
Not
   read :: f (Designator l' l' f' f') -> Expression Language l' f' f
read = f (Designator l' l' f' f') -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f') -> Expression λ l f' f
Read
   relation :: RelOp
-> f (Expression l' l' f' f')
-> f (Expression l' l' f' f')
-> Expression Language l' f' f
relation = RelOp
-> f (Expression l' l' f' f')
-> f (Expression l' l' f' f')
-> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
RelOp
-> f (Expression l l f' f')
-> f (Expression l l f' f')
-> Expression λ l f' f
Relation

   element :: f (Expression l' l' f' f') -> Element Language l' f' f
element = f (Expression l' l' f' f') -> Element Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f') -> Element λ l f' f
Oberon.Element
   range :: f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Element Language l' f' f
range = f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Element Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Expression l l f' f')
-> f (Expression l l f' f') -> Element λ l f' f
Oberon.Range

   -- Value
   builtin :: Ident -> Value Language l' f' f
builtin = Ident -> Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Ident -> Value λ l f' f
Oberon.Builtin
   integer :: Integer -> Value Language l' f' f
integer = Integer -> Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Integer -> Value λ l f' f
Oberon.Integer
   nil :: Value Language l' f' f
nil = Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Value λ l f' f
Oberon.Nil
   real :: Double -> Value Language l' f' f
real = Double -> Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Double -> Value λ l f' f
Oberon.Real
   string :: Ident -> Value Language l' f' f
string = Ident -> Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Ident -> Value λ l f' f
Oberon.String
   charCode :: Int -> Value Language l' f' f
charCode = Int -> Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Int -> Value λ l f' f
Oberon.CharCode
   false :: Value Language l' f' f
false = Bool -> Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Bool -> Value λ l f' f
Oberon.Boolean Bool
False
   true :: Value Language l' f' f
true = Bool -> Value Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *). Bool -> Value λ l f' f
Oberon.Boolean Bool
True

   -- Designator
   variable :: QualIdent l' -> Designator Language l' f' f
variable = QualIdent l' -> Designator Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
QualIdent l -> Designator λ l f' f
Variable
   field :: f (Designator l' l' f' f') -> Ident -> Designator Language l' f' f
field = f (Designator l' l' f' f') -> Ident -> Designator Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f') -> Ident -> Designator λ l f' f
Field
   index :: f (Designator l' l' f' f')
-> NonEmpty (f (Expression l' l' f' f'))
-> Designator Language l' f' f
index f (Designator l' l' f' f')
array (f (Expression l' l' f' f')
index :| [f (Expression l' l' f' f')]
indexes) = f (Designator l' l' f' f')
-> f (Expression l' l' f' f')
-> ZipList (f (Expression l' l' f' f'))
-> Designator Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f')
-> f (Expression l l f' f')
-> ZipList (f (Expression l l f' f'))
-> Designator λ l f' f
Index f (Designator l' l' f' f')
array f (Expression l' l' f' f')
index ([f (Expression l' l' f' f')]
-> ZipList (f (Expression l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (Expression l' l' f' f')]
indexes)
   dereference :: f (Designator l' l' f' f') -> Designator Language l' f' f
dereference = f (Designator l' l' f' f') -> Designator Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f') -> Designator λ l f' f
Dereference

   -- Identifier
   identDef :: Ident -> IdentDef Language
identDef = Ident -> IdentDef Language
forall l. Ident -> IdentDef l
IdentDef
   nonQualIdent :: Ident -> QualIdent Language
nonQualIdent = [Ident] -> Ident -> QualIdent Language
forall l. [Ident] -> Ident -> QualIdent l
QualIdent []

instance Abstract.CoWirthy Language where
   type TargetClass Language = Abstract.Modula2
   coDeclaration :: Declaration Language l'' f' f -> Declaration l' l'' f' f
coDeclaration (ConstantDeclaration name value) = IdentDef l''
-> f (ConstExpression l'' l'' f' f') -> Declaration l' l'' f' f
forall l l' (f :: * -> *) (f' :: * -> *).
Wirthy l =>
IdentDef l'
-> f (ConstExpression l' l' f' f') -> Declaration l l' f' f
Abstract.constantDeclaration IdentDef l''
name f (ConstExpression l'' l'' f' f')
value
   coDeclaration (TypeDeclaration name ty) = IdentDef l'' -> f (Type l'' l'' f' f') -> Declaration l' l'' f' f
forall l l' (f :: * -> *) (f' :: * -> *).
Wirthy l =>
IdentDef l' -> f (Type l' l' f' f') -> Declaration l l' f' f
Abstract.typeDeclaration IdentDef l''
name f (Type l'' l'' f' f')
ty
   coDeclaration (VariableDeclaration name ty) = IdentList l'' -> f (Type l'' l'' f' f') -> Declaration l' l'' f' f
forall l l' (f :: * -> *) (f' :: * -> *).
Wirthy l =>
IdentList l' -> f (Type l' l' f' f') -> Declaration l l' f' f
Abstract.variableDeclaration IdentList l''
name f (Type l'' l'' f' f')
ty
   coDeclaration (ProcedureDeclaration heading body) = f (ProcedureHeading l'' l'' f' f')
-> f (Block l'' l'' f' f') -> Declaration l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (ProcedureHeading l' l' f' f')
-> f (Block l' l' f' f') -> Declaration l l' f' f
Abstract.procedureDeclaration f (ProcedureHeading l'' l'' f' f')
heading f (Block l'' l'' f' f')
body
   coDeclaration (ModuleDeclaration name priority imports exports body) =
      Ident
-> Maybe (f (ConstExpression l'' l'' f' f'))
-> [Import l'']
-> Maybe (Export l'')
-> f (Block l'' l'' f' f')
-> Declaration l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Modula2 l =>
Ident
-> Maybe (f (Priority l' l' f' f'))
-> [Import l']
-> Maybe (Export l')
-> f (Block l' l' f' f')
-> Declaration l l' f' f
Abstract.moduleDeclaration Ident
name Maybe (f (ConstExpression l'' l'' f' f'))
priority [Import l'']
imports Maybe (Export l'')
exports f (Block l'' l'' f' f')
body

   coType :: Type Language l'' f' f -> Type l' l'' f' f
coType (ArrayType dimensions itemType) = [f (Type l'' l'' f' f')]
-> f (Type l'' l'' f' f') -> Type l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Modula2 l =>
[f (Type l' l' f' f')] -> f (Type l' l' f' f') -> Type l l' f' f
Abstract.arrayType (ZipList (f (Type l'' l'' f' f')) -> [f (Type l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList ZipList (f (Type l'' l'' f' f'))
dimensions) f (Type l'' l'' f' f')
itemType
   coType (EnumerationType names) = IdentList l'' -> Type l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Modula2 l =>
IdentList l' -> Type l l' f' f
Abstract.enumeration IdentList l''
names
   coType (PointerType destination) = f (Type l'' l'' f' f') -> Type l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Type l' l' f' f') -> Type l l' f' f
Abstract.pointerType f (Type l'' l'' f' f')
destination
   coType (ProcedureType params) = Maybe (f (FormalParameters l'' l'' f' f')) -> Type l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
Maybe (f (FormalParameters l' l' f' f')) -> Type l l' f' f
Abstract.procedureType Maybe (f (FormalParameters l'' l'' f' f'))
params
   coType (RecordType fields) = [f (FieldList l'' l'' f' f')] -> Type l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Modula2 l =>
[f (FieldList l' l' f' f')] -> Type l l' f' f
Abstract.recordType (ZipList (f (FieldList l'' l'' f' f'))
-> [f (FieldList l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList ZipList (f (FieldList l'' l'' f' f'))
fields)
   coType (SetType itemType) = f (Type l'' l'' f' f') -> Type l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Modula2 l =>
f (Type l' l' f' f') -> Type l l' f' f
Abstract.setType f (Type l'' l'' f' f')
itemType
   coType (SubrangeType base low high) = Maybe (QualIdent l'')
-> f (ConstExpression l'' l'' f' f')
-> f (ConstExpression l'' l'' f' f')
-> Type l' l'' f' f
forall l l' (f :: * -> *) (f' :: * -> *).
Modula2 l =>
Maybe (QualIdent l')
-> f (ConstExpression l' l' f' f')
-> f (ConstExpression l' l' f' f')
-> Type l l' f' f
Abstract.subRange Maybe (QualIdent l'')
base f (ConstExpression l'' l'' f' f')
low f (ConstExpression l'' l'' f' f')
high
   coType (TypeReference q) = QualIdent l'' -> Type l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
QualIdent l' -> Type l l' f' f
Abstract.typeReference QualIdent l''
q

   coStatement :: Statement Language l'' f' f -> Statement l' l'' f' f
coStatement Statement Language l'' f' f
EmptyStatement = Statement l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Statement l l' f' f
Abstract.emptyStatement
   coStatement (Assignment destination expression) = f (Designator l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Designator l' l' f' f')
-> f (Expression l' l' f' f') -> Statement l l' f' f
Abstract.assignment f (Designator l'' l'' f' f')
destination f (Expression l'' l'' f' f')
expression
   coStatement (ProcedureCall procedure parameters) = f (Designator l'' l'' f' f')
-> Maybe [f (Expression l'' l'' f' f')] -> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Designator l' l' f' f')
-> Maybe [f (Expression l' l' f' f')] -> Statement l l' f' f
Abstract.procedureCall f (Designator l'' l'' f' f')
procedure (Maybe [f (Expression l'' l'' f' f')] -> Statement l' l'' f' f)
-> Maybe [f (Expression l'' l'' f' f')] -> Statement l' l'' f' f
forall a b. (a -> b) -> a -> b
$ ZipList (f (Expression l'' l'' f' f'))
-> [f (Expression l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList (ZipList (f (Expression l'' l'' f' f'))
 -> [f (Expression l'' l'' f' f')])
-> Maybe (ZipList (f (Expression l'' l'' f' f')))
-> Maybe [f (Expression l'' l'' f' f')]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (ZipList (f (Expression l'' l'' f' f')))
parameters
   coStatement (If branch elsifs fallback) = NonEmpty (f (ConditionalBranch l'' l'' f' f'))
-> Maybe (f (StatementSequence l'' l'' f' f'))
-> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
NonEmpty (f (ConditionalBranch l' l' f' f'))
-> Maybe (f (StatementSequence l' l' f' f')) -> Statement l l' f' f
Abstract.ifStatement (f (ConditionalBranch l'' l'' f' f')
branch f (ConditionalBranch l'' l'' f' f')
-> [f (ConditionalBranch l'' l'' f' f')]
-> NonEmpty (f (ConditionalBranch l'' l'' f' f'))
forall a. a -> [a] -> NonEmpty a
:| ZipList (f (ConditionalBranch l'' l'' f' f'))
-> [f (ConditionalBranch l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList ZipList (f (ConditionalBranch l'' l'' f' f'))
elsifs) Maybe (f (StatementSequence l'' l'' f' f'))
fallback
   coStatement (CaseStatement scrutinee cases fallback) =
      f (Expression l'' l'' f' f')
-> [f (Case l'' l'' f' f')]
-> Maybe (f (StatementSequence l'' l'' f' f'))
-> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> [f (Case l' l' f' f')]
-> Maybe (f (StatementSequence l' l' f' f'))
-> Statement l l' f' f
Abstract.caseStatement f (Expression l'' l'' f' f')
scrutinee (ZipList (f (Case l'' l'' f' f')) -> [f (Case l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList ZipList (f (Case l'' l'' f' f'))
cases) Maybe (f (StatementSequence l'' l'' f' f'))
fallback
   coStatement (While condition body) = f (Expression l'' l'' f' f')
-> f (StatementSequence l'' l'' f' f') -> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (StatementSequence l' l' f' f') -> Statement l l' f' f
Abstract.whileStatement f (Expression l'' l'' f' f')
condition f (StatementSequence l'' l'' f' f')
body
   coStatement (Repeat body condition) = f (StatementSequence l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (StatementSequence l' l' f' f')
-> f (Expression l' l' f' f') -> Statement l l' f' f
Abstract.repeatStatement f (StatementSequence l'' l'' f' f')
body f (Expression l'' l'' f' f')
condition
   coStatement (For index from to by body) = Ident
-> f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f')
-> Maybe (f (Expression l'' l'' f' f'))
-> f (StatementSequence l'' l'' f' f')
-> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Modula2 l =>
Ident
-> f (Expression l' l' f' f')
-> f (Expression l' l' f' f')
-> Maybe (f (Expression l' l' f' f'))
-> f (StatementSequence l' l' f' f')
-> Statement l l' f' f
Abstract.forStatement Ident
index f (Expression l'' l'' f' f')
from f (Expression l'' l'' f' f')
to Maybe (f (Expression l'' l'' f' f'))
by f (StatementSequence l'' l'' f' f')
body
   coStatement (Loop body) = f (StatementSequence l'' l'' f' f') -> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (StatementSequence l' l' f' f') -> Statement l l' f' f
Abstract.loopStatement f (StatementSequence l'' l'' f' f')
body
   coStatement (With designator body) = f (Designator l'' l'' f' f')
-> f (StatementSequence l'' l'' f' f') -> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Modula2 l =>
f (Designator l' l' f' f')
-> f (StatementSequence l' l' f' f') -> Statement l l' f' f
Abstract.withStatement f (Designator l'' l'' f' f')
designator f (StatementSequence l'' l'' f' f')
body
   coStatement Statement Language l'' f' f
Exit = Statement l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Statement l l' f' f
Abstract.exitStatement
   coStatement (Return result) = Maybe (f (Expression l'' l'' f' f')) -> Statement l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
Maybe (f (Expression l' l' f' f')) -> Statement l l' f' f
Abstract.returnStatement Maybe (f (Expression l'' l'' f' f'))
result

   coExpression :: Expression Language l'' f' f -> Expression l' l'' f' f
coExpression (Relation op left right) = RelOp
-> f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f')
-> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
RelOp
-> f (Expression l' l' f' f')
-> f (Expression l' l' f' f')
-> Expression l l' f' f
Abstract.relation RelOp
op f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (Positive e) = f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.positive f (Expression l'' l'' f' f')
e
   coExpression (Negative e) = f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.negative f (Expression l'' l'' f' f')
e
   coExpression (Add left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.add f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (Subtract left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.subtract f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (Or left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.or f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (Multiply left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.multiply f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (Divide left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.divide f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (IntegerDivide left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.integerDivide f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (Literal value) = f (Value l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Value l' l' f' f') -> Expression l l' f' f
Abstract.literal f (Value l'' l'' f' f')
value
   coExpression (Modulo left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.modulo f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (And left right) = f (Expression l'' l'' f' f')
-> f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f')
-> f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.and f (Expression l'' l'' f' f')
left f (Expression l'' l'' f' f')
right
   coExpression (Set itemType elements) = Maybe (QualIdent l'')
-> [f (Element l'' l'' f' f')] -> Expression l' l'' f' f
forall l l' (f :: * -> *) (f' :: * -> *).
Modula2 l =>
Maybe (QualIdent l')
-> [f (Element l' l' f' f')] -> Expression l l' f' f
Abstract.set Maybe (QualIdent l'')
itemType (ZipList (f (Element l'' l'' f' f')) -> [f (Element l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList ZipList (f (Element l'' l'' f' f'))
elements)
   coExpression (Read var) = f (Designator l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Designator l' l' f' f') -> Expression l l' f' f
Abstract.read f (Designator l'' l'' f' f')
var
   coExpression (FunctionCall function parameters) = f (Designator l'' l'' f' f')
-> [f (Expression l'' l'' f' f')] -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Designator l' l' f' f')
-> [f (Expression l' l' f' f')] -> Expression l l' f' f
Abstract.functionCall f (Designator l'' l'' f' f')
function ([f (Expression l'' l'' f' f')] -> Expression l' l'' f' f)
-> [f (Expression l'' l'' f' f')] -> Expression l' l'' f' f
forall a b. (a -> b) -> a -> b
$ ZipList (f (Expression l'' l'' f' f'))
-> [f (Expression l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList ZipList (f (Expression l'' l'' f' f'))
parameters
   coExpression (Not e) = f (Expression l'' l'' f' f') -> Expression l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Expression l' l' f' f') -> Expression l l' f' f
Abstract.not f (Expression l'' l'' f' f')
e

   coValue :: Value Language l'' f' f -> Value l' l'' f' f
coValue Value Language l'' f' f
Oberon.Nil = Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Value l l' f' f
Abstract.nil
   coValue (Oberon.Boolean False) = Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Value l l' f' f
Abstract.false
   coValue (Oberon.Boolean True) = Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Value l l' f' f
Abstract.true
   coValue (Oberon.Builtin name) = Ident -> Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Ident -> Value l l' f' f
Abstract.builtin Ident
name
   coValue (Oberon.Integer n) = Integer -> Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Integer -> Value l l' f' f
Abstract.integer Integer
n
   coValue (Oberon.Real r) = Double -> Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Double -> Value l l' f' f
Abstract.real Double
r
   coValue (Oberon.String s) = Ident -> Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Ident -> Value l l' f' f
Abstract.string Ident
s
   coValue (Oberon.CharCode c) = Int -> Value l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
Int -> Value l l' f' f
Abstract.charCode Int
c

   coDesignator :: Designator Language l'' f' f -> Designator l' l'' f' f
coDesignator (Variable q) = QualIdent l'' -> Designator l' l'' f' f
forall l l' (f' :: * -> *) (f :: * -> *).
Wirthy l =>
QualIdent l' -> Designator l l' f' f
Abstract.variable QualIdent l''
q
   coDesignator (Field record name) = f (Designator l'' l'' f' f') -> Ident -> Designator l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Designator l' l' f' f') -> Ident -> Designator l l' f' f
Abstract.field f (Designator l'' l'' f' f')
record Ident
name
   coDesignator (Index array index indexes) = f (Designator l'' l'' f' f')
-> NonEmpty (f (Expression l'' l'' f' f'))
-> Designator l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Designator l' l' f' f')
-> NonEmpty (f (Expression l' l' f' f')) -> Designator l l' f' f
Abstract.index f (Designator l'' l'' f' f')
array (f (Expression l'' l'' f' f')
index f (Expression l'' l'' f' f')
-> [f (Expression l'' l'' f' f')]
-> NonEmpty (f (Expression l'' l'' f' f'))
forall a. a -> [a] -> NonEmpty a
:| ZipList (f (Expression l'' l'' f' f'))
-> [f (Expression l'' l'' f' f')]
forall a. ZipList a -> [a]
getZipList ZipList (f (Expression l'' l'' f' f'))
indexes)
   coDesignator (Dereference pointer) = f (Designator l'' l'' f' f') -> Designator l' l'' f' f
forall l (f :: * -> *) l' (f' :: * -> *).
Wirthy l =>
f (Designator l' l' f' f') -> Designator l l' f' f
Abstract.dereference f (Designator l'' l'' f' f')
pointer

instance Abstract.Nameable Language where
   getProcedureName :: ProcedureHeading Language l' f' f -> Ident
getProcedureName (ProcedureHeading name _) = Ident
name
   getIdentDefName :: IdentDef Language -> Ident
getIdentDefName (IdentDef n) = Ident
n
   getNonQualIdentName :: QualIdent Language -> Maybe Ident
getNonQualIdentName (QualIdent [] name) = Ident -> Maybe Ident
forall a. a -> Maybe a
Just Ident
name
   getNonQualIdentName QualIdent Language
_ = Maybe Ident
forall a. Maybe a
Nothing

instance Abstract.Modula2 Language where
   type Export Language = Export Language
   type Definition Language = Declaration False Language
   type Variant Language = Variant Language

   -- Module
   definitionModule :: Ident
-> [Import l']
-> Maybe (Export l')
-> [f (Definition l' l' f' f')]
-> Module Language l' f' f
definitionModule Ident
name [Import l']
imports Maybe (Export l')
exports [f (Definition l' l' f' f')]
definitions = Ident
-> [Import l']
-> Maybe (Export l')
-> ZipList (f (Definition l' l' f' f'))
-> Module Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Ident
-> [Import l]
-> Maybe (Export l)
-> ZipList (f (Definition l l f' f'))
-> Module λ l f' f
DefinitionModule Ident
name [Import l']
imports Maybe (Export l')
exports ([f (Definition l' l' f' f')]
-> ZipList (f (Definition l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (Definition l' l' f' f')]
definitions)
   implementationModule :: Ident
-> Maybe (f (Priority l' l' f' f'))
-> [Import l']
-> f (Block l' l' f' f')
-> Module Language l' f' f
implementationModule = Ident
-> Maybe (f (Priority l' l' f' f'))
-> [Import l']
-> f (Block l' l' f' f')
-> Module Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Ident
-> Maybe (f (Priority l l f' f'))
-> [Import l]
-> f (Block l l f' f')
-> Module λ l f' f
ImplementationModule
   programModule :: Ident
-> Maybe (f (Priority l' l' f' f'))
-> [Import l']
-> f (Block l' l' f' f')
-> Module Language l' f' f
programModule = Ident
-> Maybe (f (Priority l' l' f' f'))
-> [Import l']
-> f (Block l' l' f' f')
-> Module Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Ident
-> Maybe (f (Priority l l f' f'))
-> [Import l]
-> f (Block l l f' f')
-> Module λ l f' f
ProgramModule

   moduleExport :: Bool -> NonEmpty Ident -> Export Language
moduleExport = Bool -> NonEmpty Ident -> Export Language
forall λ. Bool -> NonEmpty Ident -> Export λ
Export
   moduleImport :: Maybe Ident -> NonEmpty Ident -> Import Language
moduleImport = Maybe Ident -> NonEmpty Ident -> Import Language
forall λ. Maybe Ident -> NonEmpty Ident -> Import λ
Import
   
   -- Definition
   constantDefinition :: IdentDef l'
-> f (ConstExpression l' l' f' f') -> Definition Language l' f' f
constantDefinition = IdentDef l'
-> f (ConstExpression l' l' f' f') -> Definition Language l' f' f
forall l (f :: * -> *) (f' :: * -> *) (x :: Bool) λ.
IdentDef l
-> f (ConstExpression l l f' f') -> Declaration x λ l f' f
ConstantDeclaration
   typeDefinition :: IdentDef l'
-> Maybe (f (Type l' l' f' f')) -> Definition Language l' f' f
typeDefinition = \IdentDef l'
name-> Declaration 'False Language l' f' f
-> (f (Type l' l' f' f') -> Declaration 'False Language l' f' f)
-> Maybe (f (Type l' l' f' f'))
-> Declaration 'False Language l' f' f
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (IdentDef l' -> Declaration 'False Language l' f' f
forall l λ (f' :: * -> *) (f :: * -> *).
IdentDef l -> Declaration 'False λ l f' f
OpaqueTypeDeclaration IdentDef l'
name) (IdentDef l'
-> f (Type l' l' f' f') -> Declaration 'False Language l' f' f
forall l (f :: * -> *) (f' :: * -> *) (x :: Bool) λ.
IdentDef l -> f (Type l l f' f') -> Declaration x λ l f' f
TypeDeclaration IdentDef l'
name)
   variableDefinition :: IdentList l' -> f (Type l' l' f' f') -> Definition Language l' f' f
variableDefinition = IdentList l' -> f (Type l' l' f' f') -> Definition Language l' f' f
forall l (f :: * -> *) (f' :: * -> *) (x :: Bool) λ.
IdentList l -> f (Type l l f' f') -> Declaration x λ l f' f
VariableDeclaration
   procedureDefinition :: f (ProcedureHeading l' l' f' f') -> Definition Language l' f' f
procedureDefinition = f (ProcedureHeading l' l' f' f') -> Definition Language l' f' f
forall (f :: * -> *) l (f' :: * -> *) λ.
f (ProcedureHeading l l f' f') -> Declaration 'False λ l f' f
ProcedureDefinition

   -- Declaration
   moduleDeclaration :: Ident
-> Maybe (f (Priority l' l' f' f'))
-> [Import l']
-> Maybe (Export l')
-> f (Block l' l' f' f')
-> Declaration Language l' f' f
moduleDeclaration = Ident
-> Maybe (f (Priority l' l' f' f'))
-> [Import l']
-> Maybe (Export l')
-> f (Block l' l' f' f')
-> Declaration Language l' f' f
forall (f :: * -> *) l (f' :: * -> *) λ.
Ident
-> Maybe (f (Priority l l f' f'))
-> [Import l]
-> Maybe (Export l)
-> f (Block l l f' f')
-> Declaration 'True λ l f' f
ModuleDeclaration

   -- Type
   arrayType :: [f (Type l' l' f' f')]
-> f (Type l' l' f' f') -> Type Language l' f' f
arrayType = ZipList (f (Type l' l' f' f'))
-> f (Type l' l' f' f') -> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
ZipList (f (Type l l f' f')) -> f (Type l l f' f') -> Type λ l f' f
ArrayType (ZipList (f (Type l' l' f' f'))
 -> f (Type l' l' f' f') -> Type Language l' f' f)
-> ([f (Type l' l' f' f')] -> ZipList (f (Type l' l' f' f')))
-> [f (Type l' l' f' f')]
-> f (Type l' l' f' f')
-> Type Language l' f' f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [f (Type l' l' f' f')] -> ZipList (f (Type l' l' f' f'))
forall a. [a] -> ZipList a
ZipList
   recordType :: [f (FieldList l' l' f' f')] -> Type Language l' f' f
recordType = ZipList (f (FieldList l' l' f' f')) -> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
ZipList (f (FieldList l l f' f')) -> Type λ l f' f
RecordType (ZipList (f (FieldList l' l' f' f')) -> Type Language l' f' f)
-> ([f (FieldList l' l' f' f')]
    -> ZipList (f (FieldList l' l' f' f')))
-> [f (FieldList l' l' f' f')]
-> Type Language l' f' f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [f (FieldList l' l' f' f')] -> ZipList (f (FieldList l' l' f' f'))
forall a. [a] -> ZipList a
ZipList

   procedureHeading :: Ident
-> Maybe (f (FormalParameters l' l' f' f'))
-> ProcedureHeading Language l' f' f
procedureHeading = Ident
-> Maybe (f (FormalParameters l' l' f' f'))
-> ProcedureHeading Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Ident
-> Maybe (f (FormalParameters l l f' f'))
-> ProcedureHeading λ l f' f
ProcedureHeading
   caseFieldList :: Maybe Ident
-> QualIdent l'
-> NonEmpty (f (Variant l' l' f' f'))
-> [f (FieldList l' l' f' f')]
-> FieldList Language l' f' f
caseFieldList Maybe Ident
n QualIdent l'
t (f (Variant l' l' f' f')
variant :| [f (Variant l' l' f' f')]
variants) [f (FieldList l' l' f' f')]
fallback = Maybe Ident
-> QualIdent l'
-> f (Variant l' l' f' f')
-> ZipList (f (Variant l' l' f' f'))
-> ZipList (f (FieldList l' l' f' f'))
-> FieldList Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Maybe Ident
-> QualIdent l
-> f (Variant l l f' f')
-> ZipList (f (Variant l l f' f'))
-> ZipList (f (FieldList l l f' f'))
-> FieldList λ l f' f
CaseFieldList Maybe Ident
n QualIdent l'
t f (Variant l' l' f' f')
variant ([f (Variant l' l' f' f')] -> ZipList (f (Variant l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (Variant l' l' f' f')]
variants) ([f (FieldList l' l' f' f')] -> ZipList (f (FieldList l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (FieldList l' l' f' f')]
fallback)
   variant :: NonEmpty (f (CaseLabels l' l' f' f'))
-> [f (FieldList l' l' f' f')] -> Variant Language l' f' f
variant (f (CaseLabels l' l' f' f')
case1 :| [f (CaseLabels l' l' f' f')]
cases) [f (FieldList l' l' f' f')]
fields = f (CaseLabels l' l' f' f')
-> ZipList (f (CaseLabels l' l' f' f'))
-> ZipList (f (FieldList l' l' f' f'))
-> Variant Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (CaseLabels l l f' f')
-> ZipList (f (CaseLabels l l f' f'))
-> ZipList (f (FieldList l l f' f'))
-> Variant λ l f' f
Variant f (CaseLabels l' l' f' f')
case1 ([f (CaseLabels l' l' f' f')]
-> ZipList (f (CaseLabels l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (CaseLabels l' l' f' f')]
cases) ([f (FieldList l' l' f' f')] -> ZipList (f (FieldList l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (FieldList l' l' f' f')]
fields)

   forStatement :: Ident
-> f (Expression l' l' f' f')
-> f (Expression l' l' f' f')
-> Maybe (f (Expression l' l' f' f'))
-> f (StatementSequence l' l' f' f')
-> Statement Language l' f' f
forStatement = Ident
-> f (Expression l' l' f' f')
-> f (Expression l' l' f' f')
-> Maybe (f (Expression l' l' f' f'))
-> f (StatementSequence l' l' f' f')
-> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Ident
-> f (Expression l l f' f')
-> f (Expression l l f' f')
-> Maybe (f (Expression l l f' f'))
-> f (StatementSequence l l f' f')
-> Statement λ l f' f
For
   withStatement :: f (Designator l' l' f' f')
-> f (StatementSequence l' l' f' f') -> Statement Language l' f' f
withStatement = f (Designator l' l' f' f')
-> f (StatementSequence l' l' f' f') -> Statement Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Designator l l f' f')
-> f (StatementSequence l l f' f') -> Statement λ l f' f
With

   enumeration :: IdentList l' -> Type Language l' f' f
enumeration = IdentList l' -> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
IdentList l -> Type λ l f' f
EnumerationType
   subRange :: Maybe (QualIdent l')
-> f (ConstExpression l' l' f' f')
-> f (ConstExpression l' l' f' f')
-> Type Language l' f' f
subRange = Maybe (QualIdent l')
-> f (ConstExpression l' l' f' f')
-> f (ConstExpression l' l' f' f')
-> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Maybe (QualIdent l)
-> f (ConstExpression l l f' f')
-> f (ConstExpression l l f' f')
-> Type λ l f' f
SubrangeType
   setType :: f (Type l' l' f' f') -> Type Language l' f' f
setType = f (Type l' l' f' f') -> Type Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
f (Type l l f' f') -> Type λ l f' f
SetType
   
   set :: Maybe (QualIdent l')
-> [f (Element l' l' f' f')] -> Expression Language l' f' f
set Maybe (QualIdent l')
memberType [f (Element l' l' f' f')]
members = Maybe (QualIdent l')
-> ZipList (f (Element l' l' f' f')) -> Expression Language l' f' f
forall λ l (f' :: * -> *) (f :: * -> *).
Maybe (QualIdent l)
-> ZipList (f (Element l l f' f')) -> Expression λ l f' f
Set Maybe (QualIdent l')
memberType ([f (Element l' l' f' f')] -> ZipList (f (Element l' l' f' f'))
forall a. [a] -> ZipList a
ZipList [f (Element l' l' f' f')]
members)
   qualIdent :: [Ident] -> Ident -> QualIdent Language
qualIdent = [Ident] -> Ident -> QualIdent Language
forall l. [Ident] -> Ident -> QualIdent l
QualIdent

newtype IdentDef l = IdentDef Ident deriving (Typeable (IdentDef l)
DataType
Constr
Typeable (IdentDef l)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> IdentDef l -> c (IdentDef l))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (IdentDef l))
-> (IdentDef l -> Constr)
-> (IdentDef l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (IdentDef l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (IdentDef l)))
-> ((forall b. Data b => b -> b) -> IdentDef l -> IdentDef l)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> IdentDef l -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> IdentDef l -> r)
-> (forall u. (forall d. Data d => d -> u) -> IdentDef l -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> IdentDef l -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l))
-> Data (IdentDef l)
IdentDef l -> DataType
IdentDef l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (IdentDef l))
(forall b. Data b => b -> b) -> IdentDef l -> IdentDef l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IdentDef l -> c (IdentDef l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (IdentDef l)
forall l. Data l => Typeable (IdentDef l)
forall l. Data l => IdentDef l -> DataType
forall l. Data l => IdentDef l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b) -> IdentDef l -> IdentDef l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> IdentDef l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> IdentDef l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (IdentDef l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IdentDef l -> c (IdentDef l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (IdentDef l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (IdentDef l))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> IdentDef l -> u
forall u. (forall d. Data d => d -> u) -> IdentDef l -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (IdentDef l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IdentDef l -> c (IdentDef l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (IdentDef l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (IdentDef l))
$cIdentDef :: Constr
$tIdentDef :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
gmapMp :: (forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
gmapM :: (forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> IdentDef l -> m (IdentDef l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> IdentDef l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> IdentDef l -> u
gmapQ :: (forall d. Data d => d -> u) -> IdentDef l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> IdentDef l -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IdentDef l -> r
gmapT :: (forall b. Data b => b -> b) -> IdentDef l -> IdentDef l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b) -> IdentDef l -> IdentDef l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (IdentDef l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (IdentDef l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (IdentDef l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (IdentDef l))
dataTypeOf :: IdentDef l -> DataType
$cdataTypeOf :: forall l. Data l => IdentDef l -> DataType
toConstr :: IdentDef l -> Constr
$ctoConstr :: forall l. Data l => IdentDef l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (IdentDef l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (IdentDef l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IdentDef l -> c (IdentDef l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IdentDef l -> c (IdentDef l)
$cp1Data :: forall l. Data l => Typeable (IdentDef l)
Data, IdentDef l -> IdentDef l -> Bool
(IdentDef l -> IdentDef l -> Bool)
-> (IdentDef l -> IdentDef l -> Bool) -> Eq (IdentDef l)
forall l. IdentDef l -> IdentDef l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentDef l -> IdentDef l -> Bool
$c/= :: forall l. IdentDef l -> IdentDef l -> Bool
== :: IdentDef l -> IdentDef l -> Bool
$c== :: forall l. IdentDef l -> IdentDef l -> Bool
Eq, Eq (IdentDef l)
Eq (IdentDef l)
-> (IdentDef l -> IdentDef l -> Ordering)
-> (IdentDef l -> IdentDef l -> Bool)
-> (IdentDef l -> IdentDef l -> Bool)
-> (IdentDef l -> IdentDef l -> Bool)
-> (IdentDef l -> IdentDef l -> Bool)
-> (IdentDef l -> IdentDef l -> IdentDef l)
-> (IdentDef l -> IdentDef l -> IdentDef l)
-> Ord (IdentDef l)
IdentDef l -> IdentDef l -> Bool
IdentDef l -> IdentDef l -> Ordering
IdentDef l -> IdentDef l -> IdentDef l
forall l. Eq (IdentDef l)
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. IdentDef l -> IdentDef l -> Bool
forall l. IdentDef l -> IdentDef l -> Ordering
forall l. IdentDef l -> IdentDef l -> IdentDef l
min :: IdentDef l -> IdentDef l -> IdentDef l
$cmin :: forall l. IdentDef l -> IdentDef l -> IdentDef l
max :: IdentDef l -> IdentDef l -> IdentDef l
$cmax :: forall l. IdentDef l -> IdentDef l -> IdentDef l
>= :: IdentDef l -> IdentDef l -> Bool
$c>= :: forall l. IdentDef l -> IdentDef l -> Bool
> :: IdentDef l -> IdentDef l -> Bool
$c> :: forall l. IdentDef l -> IdentDef l -> Bool
<= :: IdentDef l -> IdentDef l -> Bool
$c<= :: forall l. IdentDef l -> IdentDef l -> Bool
< :: IdentDef l -> IdentDef l -> Bool
$c< :: forall l. IdentDef l -> IdentDef l -> Bool
compare :: IdentDef l -> IdentDef l -> Ordering
$ccompare :: forall l. IdentDef l -> IdentDef l -> Ordering
$cp1Ord :: forall l. Eq (IdentDef l)
Ord, Int -> IdentDef l -> ShowS
[IdentDef l] -> ShowS
IdentDef l -> String
(Int -> IdentDef l -> ShowS)
-> (IdentDef l -> String)
-> ([IdentDef l] -> ShowS)
-> Show (IdentDef l)
forall l. Int -> IdentDef l -> ShowS
forall l. [IdentDef l] -> ShowS
forall l. IdentDef l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentDef l] -> ShowS
$cshowList :: forall l. [IdentDef l] -> ShowS
show :: IdentDef l -> String
$cshow :: forall l. IdentDef l -> String
showsPrec :: Int -> IdentDef l -> ShowS
$cshowsPrec :: forall l. Int -> IdentDef l -> ShowS
Show)

data Module λ l f' f = DefinitionModule Ident
                          [Abstract.Import l] (Maybe (Abstract.Export l)) (ZipList (f (Abstract.Definition l l f' f')))
                     | ImplementationModule Ident (Maybe (f (Abstract.Priority l l f' f')))
                          [Abstract.Import l] (f (Abstract.Block l l f' f'))
                     | ProgramModule Ident (Maybe (f (Abstract.Priority l l f' f')))
                          [Abstract.Import l] (f (Abstract.Block l l f' f'))

data Import λ = Import (Maybe Ident) (NonEmpty Ident) deriving (Typeable (Import λ)
DataType
Constr
Typeable (Import λ)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Import λ -> c (Import λ))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Import λ))
-> (Import λ -> Constr)
-> (Import λ -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Import λ)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Import λ)))
-> ((forall b. Data b => b -> b) -> Import λ -> Import λ)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Import λ -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Import λ -> r)
-> (forall u. (forall d. Data d => d -> u) -> Import λ -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Import λ -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Import λ -> m (Import λ))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Import λ -> m (Import λ))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Import λ -> m (Import λ))
-> Data (Import λ)
Import λ -> DataType
Import λ -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Import λ))
(forall b. Data b => b -> b) -> Import λ -> Import λ
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Import λ -> c (Import λ)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Import λ)
forall λ. Data λ => Typeable (Import λ)
forall λ. Data λ => Import λ -> DataType
forall λ. Data λ => Import λ -> Constr
forall λ.
Data λ =>
(forall b. Data b => b -> b) -> Import λ -> Import λ
forall λ u.
Data λ =>
Int -> (forall d. Data d => d -> u) -> Import λ -> u
forall λ u.
Data λ =>
(forall d. Data d => d -> u) -> Import λ -> [u]
forall λ r r'.
Data λ =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
forall λ r r'.
Data λ =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
forall λ (m :: * -> *).
(Data λ, Monad m) =>
(forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
forall λ (m :: * -> *).
(Data λ, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
forall λ (c :: * -> *).
Data λ =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Import λ)
forall λ (c :: * -> *).
Data λ =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Import λ -> c (Import λ)
forall λ (t :: * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Import λ))
forall λ (t :: * -> * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Import λ))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Import λ -> u
forall u. (forall d. Data d => d -> u) -> Import λ -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Import λ)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Import λ -> c (Import λ)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Import λ))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Import λ))
$cImport :: Constr
$tImport :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
$cgmapMo :: forall λ (m :: * -> *).
(Data λ, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
gmapMp :: (forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
$cgmapMp :: forall λ (m :: * -> *).
(Data λ, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
gmapM :: (forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
$cgmapM :: forall λ (m :: * -> *).
(Data λ, Monad m) =>
(forall d. Data d => d -> m d) -> Import λ -> m (Import λ)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Import λ -> u
$cgmapQi :: forall λ u.
Data λ =>
Int -> (forall d. Data d => d -> u) -> Import λ -> u
gmapQ :: (forall d. Data d => d -> u) -> Import λ -> [u]
$cgmapQ :: forall λ u.
Data λ =>
(forall d. Data d => d -> u) -> Import λ -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
$cgmapQr :: forall λ r r'.
Data λ =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
$cgmapQl :: forall λ r r'.
Data λ =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Import λ -> r
gmapT :: (forall b. Data b => b -> b) -> Import λ -> Import λ
$cgmapT :: forall λ.
Data λ =>
(forall b. Data b => b -> b) -> Import λ -> Import λ
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Import λ))
$cdataCast2 :: forall λ (t :: * -> * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Import λ))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Import λ))
$cdataCast1 :: forall λ (t :: * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Import λ))
dataTypeOf :: Import λ -> DataType
$cdataTypeOf :: forall λ. Data λ => Import λ -> DataType
toConstr :: Import λ -> Constr
$ctoConstr :: forall λ. Data λ => Import λ -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Import λ)
$cgunfold :: forall λ (c :: * -> *).
Data λ =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Import λ)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Import λ -> c (Import λ)
$cgfoldl :: forall λ (c :: * -> *).
Data λ =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Import λ -> c (Import λ)
$cp1Data :: forall λ. Data λ => Typeable (Import λ)
Data, Int -> Import λ -> ShowS
[Import λ] -> ShowS
Import λ -> String
(Int -> Import λ -> ShowS)
-> (Import λ -> String) -> ([Import λ] -> ShowS) -> Show (Import λ)
forall λ. Int -> Import λ -> ShowS
forall λ. [Import λ] -> ShowS
forall λ. Import λ -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Import λ] -> ShowS
$cshowList :: forall λ. [Import λ] -> ShowS
show :: Import λ -> String
$cshow :: forall λ. Import λ -> String
showsPrec :: Int -> Import λ -> ShowS
$cshowsPrec :: forall λ. Int -> Import λ -> ShowS
Show)
data Export λ = Export Bool (NonEmpty Ident) deriving (Typeable (Export λ)
DataType
Constr
Typeable (Export λ)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Export λ -> c (Export λ))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Export λ))
-> (Export λ -> Constr)
-> (Export λ -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Export λ)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Export λ)))
-> ((forall b. Data b => b -> b) -> Export λ -> Export λ)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Export λ -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Export λ -> r)
-> (forall u. (forall d. Data d => d -> u) -> Export λ -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Export λ -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Export λ -> m (Export λ))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Export λ -> m (Export λ))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Export λ -> m (Export λ))
-> Data (Export λ)
Export λ -> DataType
Export λ -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Export λ))
(forall b. Data b => b -> b) -> Export λ -> Export λ
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Export λ -> c (Export λ)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Export λ)
forall λ. Data λ => Typeable (Export λ)
forall λ. Data λ => Export λ -> DataType
forall λ. Data λ => Export λ -> Constr
forall λ.
Data λ =>
(forall b. Data b => b -> b) -> Export λ -> Export λ
forall λ u.
Data λ =>
Int -> (forall d. Data d => d -> u) -> Export λ -> u
forall λ u.
Data λ =>
(forall d. Data d => d -> u) -> Export λ -> [u]
forall λ r r'.
Data λ =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
forall λ r r'.
Data λ =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
forall λ (m :: * -> *).
(Data λ, Monad m) =>
(forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
forall λ (m :: * -> *).
(Data λ, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
forall λ (c :: * -> *).
Data λ =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Export λ)
forall λ (c :: * -> *).
Data λ =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Export λ -> c (Export λ)
forall λ (t :: * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Export λ))
forall λ (t :: * -> * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Export λ))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Export λ -> u
forall u. (forall d. Data d => d -> u) -> Export λ -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Export λ)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Export λ -> c (Export λ)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Export λ))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Export λ))
$cExport :: Constr
$tExport :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
$cgmapMo :: forall λ (m :: * -> *).
(Data λ, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
gmapMp :: (forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
$cgmapMp :: forall λ (m :: * -> *).
(Data λ, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
gmapM :: (forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
$cgmapM :: forall λ (m :: * -> *).
(Data λ, Monad m) =>
(forall d. Data d => d -> m d) -> Export λ -> m (Export λ)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Export λ -> u
$cgmapQi :: forall λ u.
Data λ =>
Int -> (forall d. Data d => d -> u) -> Export λ -> u
gmapQ :: (forall d. Data d => d -> u) -> Export λ -> [u]
$cgmapQ :: forall λ u.
Data λ =>
(forall d. Data d => d -> u) -> Export λ -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
$cgmapQr :: forall λ r r'.
Data λ =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
$cgmapQl :: forall λ r r'.
Data λ =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Export λ -> r
gmapT :: (forall b. Data b => b -> b) -> Export λ -> Export λ
$cgmapT :: forall λ.
Data λ =>
(forall b. Data b => b -> b) -> Export λ -> Export λ
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Export λ))
$cdataCast2 :: forall λ (t :: * -> * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Export λ))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Export λ))
$cdataCast1 :: forall λ (t :: * -> *) (c :: * -> *).
(Data λ, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Export λ))
dataTypeOf :: Export λ -> DataType
$cdataTypeOf :: forall λ. Data λ => Export λ -> DataType
toConstr :: Export λ -> Constr
$ctoConstr :: forall λ. Data λ => Export λ -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Export λ)
$cgunfold :: forall λ (c :: * -> *).
Data λ =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Export λ)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Export λ -> c (Export λ)
$cgfoldl :: forall λ (c :: * -> *).
Data λ =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Export λ -> c (Export λ)
$cp1Data :: forall λ. Data λ => Typeable (Export λ)
Data, Int -> Export λ -> ShowS
[Export λ] -> ShowS
Export λ -> String
(Int -> Export λ -> ShowS)
-> (Export λ -> String) -> ([Export λ] -> ShowS) -> Show (Export λ)
forall λ. Int -> Export λ -> ShowS
forall λ. [Export λ] -> ShowS
forall λ. Export λ -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Export λ] -> ShowS
$cshowList :: forall λ. [Export λ] -> ShowS
show :: Export λ -> String
$cshow :: forall λ. Export λ -> String
showsPrec :: Int -> Export λ -> ShowS
$cshowsPrec :: forall λ. Int -> Export λ -> ShowS
Show)

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f', Data (Abstract.Import l), Data (Abstract.Export l),
                   Data (f (Abstract.Priority l l f' f')),
                   Data (f (Abstract.Declaration l l f' f')), Data (f (Abstract.Definition l l f' f')),
                   Data (f (Abstract.Block l l f' f'))) => Data (Module λ l f' f)
deriving instance (Show (Abstract.Import l), Show (Abstract.Export l), Show (f (Abstract.Priority l l f' f')),
                   Show (f (Abstract.Declaration l l f' f')), Show (f (Abstract.Definition l l f' f')),
                   Show (f (Abstract.Block l l f' f'))) => Show (Module λ l f' f)

data Declaration (full :: Bool) λ l (f' :: * -> *) (f :: * -> *) where
   ConstantDeclaration :: Abstract.IdentDef l -> f (Abstract.ConstExpression l l f' f') -> Declaration x λ l f' f
   TypeDeclaration :: Abstract.IdentDef l -> f (Abstract.Type l l f' f') -> Declaration x λ l f' f
   OpaqueTypeDeclaration :: Abstract.IdentDef l -> Declaration False λ l f' f
   VariableDeclaration :: Abstract.IdentList l -> f (Abstract.Type l l f' f') -> Declaration x λ l f' f
   ProcedureDeclaration :: f (Abstract.ProcedureHeading l l f' f') -> f (Abstract.Block l l f' f')
                        -> Declaration True λ l f' f
   ProcedureDefinition :: f (Abstract.ProcedureHeading l l f' f') -> Declaration False λ l f' f
   ModuleDeclaration :: Ident -> Maybe (f (Abstract.Priority l l f' f')) -> [Abstract.Import l]
                     -> Maybe (Abstract.Export l) -> f (Abstract.Block l l f' f') -> Declaration True λ l f' f

{-
deriving instance (Data l, Typeable x, Typeable f, Typeable f', Show (Abstract.Import l),
                   Data (Abstract.Import l), Data (f (Abstract.Type l l f' f')), Data (f (Abstract.ConstExpression l l f' f')),
                   Data (f (Abstract.FormalParameters l l f' f')), Data (f (Abstract.ProcedureHeading l l f' f')),
                   Data (f (Abstract.Block l l f' f')), Data (Abstract.IdentDef l)) => Data (Declaration x l f' f)
-}
deriving instance (Show (Abstract.Export l), Show (Abstract.Import l),
                   Show (f (Abstract.Type l l f' f')), Show (f (Abstract.ConstExpression l l f' f')),
                   Show (f (Abstract.FormalParameters l l f' f')), Show (f (Abstract.ProcedureHeading l l f' f')),
                   Show (f (Abstract.Block l l f' f')), Show (f (Abstract.Block l l f' f')),
                   Show (Abstract.IdentDef l)) => Show (Declaration λ x l f' f)

data QualIdent l = QualIdent [Ident] Ident 
   deriving (Typeable (QualIdent l)
DataType
Constr
Typeable (QualIdent l)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> QualIdent l -> c (QualIdent l))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (QualIdent l))
-> (QualIdent l -> Constr)
-> (QualIdent l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (QualIdent l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (QualIdent l)))
-> ((forall b. Data b => b -> b) -> QualIdent l -> QualIdent l)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> QualIdent l -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> QualIdent l -> r)
-> (forall u. (forall d. Data d => d -> u) -> QualIdent l -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> QualIdent l -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l))
-> Data (QualIdent l)
QualIdent l -> DataType
QualIdent l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (QualIdent l))
(forall b. Data b => b -> b) -> QualIdent l -> QualIdent l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> QualIdent l -> c (QualIdent l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (QualIdent l)
forall l. Data l => Typeable (QualIdent l)
forall l. Data l => QualIdent l -> DataType
forall l. Data l => QualIdent l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b) -> QualIdent l -> QualIdent l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> QualIdent l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> QualIdent l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (QualIdent l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> QualIdent l -> c (QualIdent l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (QualIdent l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (QualIdent l))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> QualIdent l -> u
forall u. (forall d. Data d => d -> u) -> QualIdent l -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (QualIdent l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> QualIdent l -> c (QualIdent l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (QualIdent l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (QualIdent l))
$cQualIdent :: Constr
$tQualIdent :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
gmapMp :: (forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
gmapM :: (forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> QualIdent l -> m (QualIdent l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> QualIdent l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> QualIdent l -> u
gmapQ :: (forall d. Data d => d -> u) -> QualIdent l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> QualIdent l -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> QualIdent l -> r
gmapT :: (forall b. Data b => b -> b) -> QualIdent l -> QualIdent l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b) -> QualIdent l -> QualIdent l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (QualIdent l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (QualIdent l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (QualIdent l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (QualIdent l))
dataTypeOf :: QualIdent l -> DataType
$cdataTypeOf :: forall l. Data l => QualIdent l -> DataType
toConstr :: QualIdent l -> Constr
$ctoConstr :: forall l. Data l => QualIdent l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (QualIdent l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (QualIdent l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> QualIdent l -> c (QualIdent l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> QualIdent l -> c (QualIdent l)
$cp1Data :: forall l. Data l => Typeable (QualIdent l)
Data, QualIdent l -> QualIdent l -> Bool
(QualIdent l -> QualIdent l -> Bool)
-> (QualIdent l -> QualIdent l -> Bool) -> Eq (QualIdent l)
forall l. QualIdent l -> QualIdent l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QualIdent l -> QualIdent l -> Bool
$c/= :: forall l. QualIdent l -> QualIdent l -> Bool
== :: QualIdent l -> QualIdent l -> Bool
$c== :: forall l. QualIdent l -> QualIdent l -> Bool
Eq, Eq (QualIdent l)
Eq (QualIdent l)
-> (QualIdent l -> QualIdent l -> Ordering)
-> (QualIdent l -> QualIdent l -> Bool)
-> (QualIdent l -> QualIdent l -> Bool)
-> (QualIdent l -> QualIdent l -> Bool)
-> (QualIdent l -> QualIdent l -> Bool)
-> (QualIdent l -> QualIdent l -> QualIdent l)
-> (QualIdent l -> QualIdent l -> QualIdent l)
-> Ord (QualIdent l)
QualIdent l -> QualIdent l -> Bool
QualIdent l -> QualIdent l -> Ordering
QualIdent l -> QualIdent l -> QualIdent l
forall l. Eq (QualIdent l)
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. QualIdent l -> QualIdent l -> Bool
forall l. QualIdent l -> QualIdent l -> Ordering
forall l. QualIdent l -> QualIdent l -> QualIdent l
min :: QualIdent l -> QualIdent l -> QualIdent l
$cmin :: forall l. QualIdent l -> QualIdent l -> QualIdent l
max :: QualIdent l -> QualIdent l -> QualIdent l
$cmax :: forall l. QualIdent l -> QualIdent l -> QualIdent l
>= :: QualIdent l -> QualIdent l -> Bool
$c>= :: forall l. QualIdent l -> QualIdent l -> Bool
> :: QualIdent l -> QualIdent l -> Bool
$c> :: forall l. QualIdent l -> QualIdent l -> Bool
<= :: QualIdent l -> QualIdent l -> Bool
$c<= :: forall l. QualIdent l -> QualIdent l -> Bool
< :: QualIdent l -> QualIdent l -> Bool
$c< :: forall l. QualIdent l -> QualIdent l -> Bool
compare :: QualIdent l -> QualIdent l -> Ordering
$ccompare :: forall l. QualIdent l -> QualIdent l -> Ordering
$cp1Ord :: forall l. Eq (QualIdent l)
Ord, Int -> QualIdent l -> ShowS
[QualIdent l] -> ShowS
QualIdent l -> String
(Int -> QualIdent l -> ShowS)
-> (QualIdent l -> String)
-> ([QualIdent l] -> ShowS)
-> Show (QualIdent l)
forall l. Int -> QualIdent l -> ShowS
forall l. [QualIdent l] -> ShowS
forall l. QualIdent l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QualIdent l] -> ShowS
$cshowList :: forall l. [QualIdent l] -> ShowS
show :: QualIdent l -> String
$cshow :: forall l. QualIdent l -> String
showsPrec :: Int -> QualIdent l -> ShowS
$cshowsPrec :: forall l. Int -> QualIdent l -> ShowS
Show)

data Expression λ l f' f = Relation Oberon.RelOp (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | Positive (f (Abstract.Expression l l f' f'))
                         | Negative (f (Abstract.Expression l l f' f'))
                         | Add (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | Subtract (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | Or (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | Multiply (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | Divide (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | IntegerDivide (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | Modulo (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | And (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f'))
                         | Set (Maybe (Abstract.QualIdent l)) (ZipList (f (Abstract.Element l l f' f')))
                         | Read (f (Abstract.Designator l l f' f'))
                         | FunctionCall (f (Abstract.Designator l l f' f')) (ZipList (f (Abstract.Expression l l f' f')))
                         | Not (f (Abstract.Expression l l f' f'))
                         | Literal (f (Abstract.Value l l f' f'))

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f', Data (Abstract.QualIdent l),
                   Data (f (Abstract.Designator l l f' f')), Data (f (Abstract.Element l l f' f')),
                   Data (f (Abstract.Value l l f' f')), Data (f (Abstract.Expression l l f' f'))) =>
                  Data (Expression λ l f' f)
deriving instance (Show (Abstract.QualIdent l), Show (f (Abstract.Designator l l f' f')),
                   Show (f (Abstract.Element l l f' f')), Show (f (Abstract.Value l l f' f')),
                   Show (f (Abstract.Expression l l f' f'))) =>
                  Show (Expression λ l f' f)
deriving instance (Eq (Abstract.QualIdent l), Eq (f (Abstract.Designator l l f' f')),
                   Eq (f (Abstract.Element l l f' f')), Eq (f (Abstract.Value l l f' f')),
                   Eq (f (Abstract.Expression l l f' f'))) =>
                  Eq (Expression λ l f' f)

data Designator λ l f' f = Variable (Abstract.QualIdent l)
                         | Field (f (Abstract.Designator l l f' f')) Ident 
                         | Index (f (Abstract.Designator l l f' f'))
                                 (f (Abstract.Expression l l f' f')) (ZipList (f (Abstract.Expression l l f' f')))
                         | Dereference (f (Abstract.Designator l l f' f'))

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f', Data (Abstract.QualIdent l),
                   Data (f (Abstract.Designator l l f' f')), Data (f (Abstract.Expression l l f' f'))) =>
                  Data (Designator λ l f' f)
deriving instance (Show (Abstract.QualIdent l), Show (f (Abstract.Designator l l f' f')),
                   Show (f (Abstract.Expression l l f' f'))) => Show (Designator λ l f' f)
deriving instance (Eq (Abstract.QualIdent l), Eq (f (Abstract.Designator l l f' f')),
                   Eq (f (Abstract.Expression l l f' f'))) => Eq (Designator λ l f' f)

data Type λ l f' f = TypeReference (Abstract.QualIdent l)
                   | ArrayType (ZipList (f (Abstract.Type l l f' f'))) (f (Abstract.Type l l f' f'))
                   | EnumerationType (Abstract.IdentList l)
                   | SubrangeType (Maybe (Abstract.QualIdent l))
                                  (f (Abstract.ConstExpression l l f' f')) (f (Abstract.ConstExpression l l f' f'))
                   | SetType (f (Abstract.Type l l f' f'))
                   | RecordType (ZipList (f (Abstract.FieldList l l f' f')))
                   | PointerType (f (Abstract.Type l l f' f'))
                   | ProcedureType (Maybe (f (Abstract.FormalParameters l l f' f')))

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f',
                   Data (Abstract.QualIdent l), Data (Abstract.IdentList l),
                   Data (f (Abstract.Type l l f' f')), Data (f (Abstract.ConstExpression l l f' f')),
                   Data (f (Abstract.FormalParameters l l f' f')), Data (f (Abstract.FieldList l l f' f'))) =>
                  Data (Type λ l f' f)
deriving instance (Show (Abstract.QualIdent l), Show (Abstract.IdentList l), Show (f (Abstract.Type l l f' f')),
                   Show (f (Abstract.ConstExpression l l f' f')), Show (f (Abstract.FormalParameters l l f' f')),
                   Show (f (Abstract.FieldList l l f' f'))) =>
                  Show (Type λ l f' f)

data FieldList λ l f' f = FieldList (Abstract.IdentList l) (f (Abstract.Type l l f' f'))
                        | CaseFieldList (Maybe Ident) (Abstract.QualIdent l)
                                        (f (Abstract.Variant l l f' f')) (ZipList (f (Abstract.Variant l l f' f')))
                                        (ZipList (f (Abstract.FieldList l l f' f')))

data Variant λ l f' f =
  Variant (f (Abstract.CaseLabels l l f' f')) (ZipList (f (Abstract.CaseLabels l l f' f')))
          (ZipList (f (Abstract.FieldList l l f' f')))

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f',
                   Data (Abstract.QualIdent l), Data (Abstract.IdentList l), Data (f (Abstract.Type l l f' f')),
                   Data (f (Abstract.Expression l l f' f')), Data (f (Abstract.Variant l l f' f')),
                   Data (f (Abstract.FieldList l l f' f'))) => Data (FieldList λ l f' f)
deriving instance (Show (Abstract.QualIdent l), Show (Abstract.IdentList l), Show (f (Abstract.Type l l f' f')),
                   Show (f (Abstract.Expression l l f' f')), Show (f (Abstract.Variant l l f' f')),
                   Show (f (Abstract.FieldList l l f' f'))) => Show (FieldList λ l f' f)

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f', Data (f (Abstract.CaseLabels l l f' f')),
                   Data (f (Abstract.FieldList l l f' f'))) => Data (Variant λ l f' f)
deriving instance (Show (f (Abstract.CaseLabels l l f' f')), Show (f (Abstract.FieldList l l f' f')))
               => Show (Variant λ l f' f)

data ProcedureHeading λ l f' f = ProcedureHeading Ident (Maybe (f (Abstract.FormalParameters l l f' f')))

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f', Data (f (Abstract.FormalParameters l l f' f'))) =>
                  Data (ProcedureHeading λ l f' f)
deriving instance (Show (f (Abstract.FormalParameters l l f' f'))) =>
                  Show (ProcedureHeading λ l f' f)

data Statement λ l f' f = EmptyStatement
                        | Assignment (f (Abstract.Designator l l f' f')) (f (Abstract.Expression l l f' f'))
                        | ProcedureCall (f (Abstract.Designator l l f' f')) (Maybe (ZipList (f (Abstract.Expression l l f' f'))))
                        | If (f (Abstract.ConditionalBranch l l f' f'))
                             (ZipList (f (Abstract.ConditionalBranch l l f' f')))
                             (Maybe (f (Abstract.StatementSequence l l f' f')))
                        | CaseStatement (f (Abstract.Expression l l f' f')) 
                                        (ZipList (f (Abstract.Case l l f' f')))
                                        (Maybe (f (Abstract.StatementSequence l l f' f')))
                        | While (f (Abstract.Expression l l f' f')) (f (Abstract.StatementSequence l l f' f'))
                        | Repeat (f (Abstract.StatementSequence l l f' f')) (f (Abstract.Expression l l f' f'))
                        | For Ident (f (Abstract.Expression l l f' f')) (f (Abstract.Expression l l f' f')) 
                              (Maybe (f (Abstract.Expression l l f' f'))) (f (Abstract.StatementSequence l l f' f'))
                        | Loop (f (Abstract.StatementSequence l l f' f'))
                        | With (f (Abstract.Designator l l f' f')) (f (Abstract.StatementSequence l l f' f'))
                        | Exit
                        | Return (Maybe (f (Abstract.Expression l l f' f')))

deriving instance (Typeable λ, Typeable l, Typeable f, Typeable f',
                   Data (f (Abstract.Designator l l f' f')), Data (f (Abstract.Expression l l f' f')),
                   Data (f (Abstract.Case l l f' f')), Data (f (Abstract.ConditionalBranch l l f' f')),
                   Data (f (Abstract.StatementSequence l l f' f'))) => Data (Statement λ l f' f)
deriving instance (Show (f (Abstract.Designator l l f' f')), Show (f (Abstract.Expression l l f' f')),
                   Show (f (Abstract.Case l l f' f')), Show (f (Abstract.ConditionalBranch l l f' f')),
                   Show (f (Abstract.StatementSequence l l f' f'))) => Show (Statement λ l f' f)

$(concat <$>
  (forM [Rank2.TH.deriveFunctor, Rank2.TH.deriveFoldable, Rank2.TH.deriveTraversable,
         Transformation.Shallow.TH.deriveAll, Transformation.Deep.TH.deriveAll] $
   \derive-> mconcat <$> mapM derive
             [''Module, ''Declaration, ''Type, ''Statement, ''Expression,
              ''Designator, ''FieldList, ''Variant, ''ProcedureHeading]))

$(mconcat <$> mapM Rank2.TH.unsafeDeriveApply
   [''Module, ''Declaration, ''Type, ''Statement, ''Expression,
     ''Designator, ''FieldList, ''Variant, ''ProcedureHeading])