úÎ M(Gé9      !"#$%&'()*+,-./012345678  9WMapping from types to the list of types (with specific constructor instantiations, the '[[Type]]') in the same binding group. :Map for looking up vars ;The next edge, parent and type <Graph of our type dependencies =8Edges can be Strong (direct) or Weak (through variable) >Uniform representation of 'data' and  'newtype' ?/Find cyclic type dependencies (binding groups) @Get a unified type for 'data' and  'newtype' A$Get the types of a type application 9>BC?@A9>BBC?@A;Data type describing grammatical structures of data types, 5 including information about precedences. The type  DGrammar a * describes the grammar of the data type a. &A grammar consists of an environment (D ) with the * defined non-terminals and a reference (E ) to the  main non-terminal in the environment. !DClass of data types with typed grammar representation. It has to be + instantiated in order to use the function Text.GRead.gread. CInstances can be derived automatically using the functions defined  in the module Text.GRead.Derive. $For example, given the declarations   infixl 5 :<:  infixr 6 :>:, :*:   data T1 = T1 :<: T1  | T1 :>: T1  | C1   data T2 a = a :*: T2 a  | C2 the instances of ! can be   _0 = Zero  _1 = Suc _0   instance Gram T1 where  grammar = DGrammar _0 envT1  % envT1 :: Env DGram ((),T1) ((),T1) " envT1 = consD (nonts _0) Empty  where  nonts _T1 = DLNontDefs  [ ( DRef (_T1, 5) 9 , DPS [ dNont (_T1, 5) .#. dTerm ":<:" .#. 7 dNont (_T1, 6) .#. dEnd infixL ]  )  , ( DRef (_T1, 6) 9 , DPS [ dNont (_T1, 7) .#. dTerm ":>:" .#. 8 dNont (_T1, 6) .#. dEnd infixR ]  )  , ( DRef (_T1,10) 7 , DPS [ dTerm "C1" .#. dEnd (const C1) 7 , dTerm "(" .#. dNont (_T1,0) .#. 3 dTerm ")" .#. dEnd parenT ]  )  ] $ infixL e1 _ e2 = e2 :<: e1 % infixR e1 _ e2 = e2 :>: e1  & instance Gram a => Gram (T2 a) where " grammar = DGrammar _0 envT2  / envT2 :: (Gram a) => Env DGram (((),a),T2 a) / (((),a),T2 a) " envT2 = consD (nonts _0 _1) $  consG grammar Empty  where ! nonts _T2 _A = DLNontDefs  [ ( DRef (_T2, 6) < , DPS [ dNont (_A, 7) .#. dTerm ":*:" .#. : dNont (_T2, 7) .#. dEnd infixT ]  )  , ( DRef (_T2,10) 7 , DPS [ dTerm "C2" .#. dEnd (const C2) : , dTerm "(" .#. dNont (_T2,0) .#. 6 dTerm ")" .#. dEnd parenT ]  )  ] % infixP e1 _ e2 = e2 :+: e1 & infixT e1 _ e2 = e2 :*: e1 @In case of mutually recursive datatypes, their definitions have 2 to be tupled together into a single environment. " The function "' returns the grammar representation of  the data type. .  !"#$%&'()*+,-.!" #$%&'()   *+,-.    !""#$%&'()*+,- FGHIJKLMNOP FGGHIJJKLMNOP QRSTUVWXYZ[\]^_`abQRSRSTUVUVWXYZYZ[\]^_`ab cc dd. Derive a Text.GRead.GramA instance. This is a Template Haskell function. Usage example:  data T1 = C1 | C2 | C3  $(deriveGrammar ''T1) /Simpler version of . that doesn't do binding group O calculations. Use this for large types without cyclic references to other  types. 'For example, if you want to derive the  HDYRM.Gram for T3 and T4 $ below, you will need the normal ..  data T3 = T3 T4 | C3 data T4 = T4 T3 | C4 ./././0Type of 4 results. 3Type of error repair messages. 4The 4+ reads input from a string, which must be - completely consumed by the input process.  Returns Ok value on a successful parse.  Otherwise returns Rep value msgs , where the value 1 results of parsing a repaired input. The list msgs  contains the " corrections" done to the input. For example, a e -like implementation can be: ! read :: (Gram a) => String -> a " read input = case gread input of # Ok a -> a 0 Rep _ (m:_) -> error $ show m 3  !"#$%&'()*+,-01234430210211234567f85678567678g !"#$%%&&'()**+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPPQRRSTUVWX Y Y Z [ [ \ ] ^ ^ _ ` a b c d e f g h i jklChristmasTree-0.1.1Text.GRead.GrammarText.GRead.Derive Text.GRead Text.GShowText.GRead.Derive.BindingGroup TTTAS-0.2.1Language.TTTAS$Text.GRead.Transformations.GramTrafo Text.GRead.Transformations.Group%Text.GRead.Transformations.LeftCorner#Text.GRead.Transformations.LeftFactbase Text.ReadTokenCloseOpenKeywSymbolTermNontProdEndSeq ProductionsPSunPSGrammarDSymbolDTermDNontDProdDEndDSeq DProductionsDPSunDPS DLNontDefsDRefDGramDGGDGDDGrammarGramgrammar.#.consGconsDdNontdTermdEndparenText.*.matchSymappend deriveGrammarderiveSimpleGrammar GReadResultRepOkGReadMsggreadGShowgshow gshowsPrec deriveShow BindingGroupVarMapNextEdge TypeGraphEdgeTypeUserTypegetBindingGroup getUserType unrollAppUserDshowBindingGroupEnvRefMapping GramTrafoMapA_XemptyMap extendMapinitMapnewNontR map2transmapProdDMapping unDMappingListDRunListDRGTrafoDTunDT mapDP2Proddp2prodld2nt dmap2transplookupgroupgGrammargDGrams leftcorner leftfactoringreadapp_prec