forked from GitHub/gf-core
Transfer: changed syntax to remove the mandatory type annotation in let.
This commit is contained in:
@@ -158,9 +158,9 @@ argument + 1.
|
||||
To give local definition to some names, use:
|
||||
|
||||
```
|
||||
let x1 : T1 = exp1
|
||||
let x1 = exp1
|
||||
...
|
||||
xn : Tn = expn
|
||||
xn = expn
|
||||
in exp
|
||||
```
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ data Tree :: * -> * where
|
||||
EInteger :: Integer -> Tree Exp_
|
||||
EDouble :: Double -> Tree Exp_
|
||||
EMeta :: TMeta -> Tree Exp_
|
||||
LetDef :: CIdent -> Exp -> Exp -> Tree LetDef_
|
||||
LetDef :: CIdent -> Exp -> Tree LetDef_
|
||||
Case :: Pattern -> Exp -> Exp -> Tree Case_
|
||||
FieldType :: CIdent -> Exp -> Tree FieldType_
|
||||
FieldValue :: CIdent -> Exp -> Tree FieldValue_
|
||||
@@ -103,7 +103,7 @@ composOpM f t = case t of
|
||||
ERec fieldvalues -> return ERec `ap` mapM f fieldvalues
|
||||
EVar cident -> return EVar `ap` f cident
|
||||
EMeta tmeta -> return EMeta `ap` f tmeta
|
||||
LetDef cident exp0 exp1 -> return LetDef `ap` f cident `ap` f exp0 `ap` f exp1
|
||||
LetDef cident exp -> return LetDef `ap` f cident `ap` f exp
|
||||
Case pattern exp0 exp1 -> return Case `ap` f pattern `ap` f exp0 `ap` f exp1
|
||||
FieldType cident exp -> return FieldType `ap` f cident `ap` f exp
|
||||
FieldValue cident exp -> return FieldValue `ap` f cident `ap` f exp
|
||||
@@ -131,7 +131,7 @@ composOpFold zero combine f t = case t of
|
||||
ERec fieldvalues -> foldr combine zero (map f fieldvalues)
|
||||
EVar cident -> f cident
|
||||
EMeta tmeta -> f tmeta
|
||||
LetDef cident exp0 exp1 -> f cident `combine` f exp0 `combine` f exp1
|
||||
LetDef cident exp -> f cident `combine` f exp
|
||||
Case pattern exp0 exp1 -> f pattern `combine` f exp0 `combine` f exp1
|
||||
FieldType cident exp -> f cident `combine` f exp
|
||||
FieldValue cident exp -> f cident `combine` f exp
|
||||
@@ -167,7 +167,7 @@ instance Show (Tree c) where
|
||||
EInteger n -> opar n . showString "EInteger" . showChar ' ' . showsPrec 1 n . cpar n
|
||||
EDouble d -> opar n . showString "EDouble" . showChar ' ' . showsPrec 1 d . cpar n
|
||||
EMeta tmeta -> opar n . showString "EMeta" . showChar ' ' . showsPrec 1 tmeta . cpar n
|
||||
LetDef cident exp0 exp1 -> opar n . showString "LetDef" . showChar ' ' . showsPrec 1 cident . showChar ' ' . showsPrec 1 exp0 . showChar ' ' . showsPrec 1 exp1 . cpar n
|
||||
LetDef cident exp -> opar n . showString "LetDef" . showChar ' ' . showsPrec 1 cident . showChar ' ' . showsPrec 1 exp . cpar n
|
||||
Case pattern exp0 exp1 -> opar n . showString "Case" . showChar ' ' . showsPrec 1 pattern . showChar ' ' . showsPrec 1 exp0 . showChar ' ' . showsPrec 1 exp1 . cpar n
|
||||
FieldType cident exp -> opar n . showString "FieldType" . showChar ' ' . showsPrec 1 cident . showChar ' ' . showsPrec 1 exp . cpar n
|
||||
FieldValue cident exp -> opar n . showString "FieldValue" . showChar ' ' . showsPrec 1 cident . showChar ' ' . showsPrec 1 exp . cpar n
|
||||
@@ -207,7 +207,7 @@ johnMajorEq (EStr str) (EStr str_) = str == str_
|
||||
johnMajorEq (EInteger n) (EInteger n_) = n == n_
|
||||
johnMajorEq (EDouble d) (EDouble d_) = d == d_
|
||||
johnMajorEq (EMeta tmeta) (EMeta tmeta_) = tmeta == tmeta_
|
||||
johnMajorEq (LetDef cident exp0 exp1) (LetDef cident_ exp0_ exp1_) = cident == cident_ && exp0 == exp0_ && exp1 == exp1_
|
||||
johnMajorEq (LetDef cident exp) (LetDef cident_ exp_) = cident == cident_ && exp == exp_
|
||||
johnMajorEq (Case pattern exp0 exp1) (Case pattern_ exp0_ exp1_) = pattern == pattern_ && exp0 == exp0_ && exp1 == exp1_
|
||||
johnMajorEq (FieldType cident exp) (FieldType cident_ exp_) = cident == cident_ && exp == exp_
|
||||
johnMajorEq (FieldValue cident exp) (FieldValue cident_ exp_) = cident == cident_ && exp == exp_
|
||||
@@ -246,7 +246,7 @@ instance Ord (Tree c) where
|
||||
index (EInteger _) = 25
|
||||
index (EDouble _) = 26
|
||||
index (EMeta _) = 27
|
||||
index (LetDef _ _ _) = 28
|
||||
index (LetDef _ _) = 28
|
||||
index (Case _ _ _) = 29
|
||||
index (FieldType _ _) = 30
|
||||
index (FieldValue _ _) = 31
|
||||
@@ -280,7 +280,7 @@ instance Ord (Tree c) where
|
||||
compareSame (EInteger n) (EInteger n_) = compare n n_
|
||||
compareSame (EDouble d) (EDouble d_) = compare d d_
|
||||
compareSame (EMeta tmeta) (EMeta tmeta_) = compare tmeta tmeta_
|
||||
compareSame (LetDef cident exp0 exp1) (LetDef cident_ exp0_ exp1_) = mappend (compare cident cident_) (mappend (compare exp0 exp0_) (compare exp1 exp1_))
|
||||
compareSame (LetDef cident exp) (LetDef cident_ exp_) = mappend (compare cident cident_) (compare exp exp_)
|
||||
compareSame (Case pattern exp0 exp1) (Case pattern_ exp0_ exp1_) = mappend (compare pattern pattern_) (mappend (compare exp0 exp0_) (compare exp1 exp1_))
|
||||
compareSame (FieldType cident exp) (FieldType cident_ exp_) = mappend (compare cident cident_) (compare exp exp_)
|
||||
compareSame (FieldValue cident exp) (FieldValue cident_ exp_) = mappend (compare cident cident_) (compare exp exp_)
|
||||
|
||||
@@ -42,7 +42,7 @@ PVWild. PatternVariable ::= "_" ;
|
||||
|
||||
-- Let expressions.
|
||||
ELet. Exp ::= "let" "{" [LetDef] "}" "in" Exp ;
|
||||
LetDef. LetDef ::= CIdent ":" Exp "=" Exp ;
|
||||
LetDef. LetDef ::= CIdent "=" Exp ;
|
||||
separator LetDef ";" ;
|
||||
|
||||
-- Case expressions.
|
||||
@@ -50,11 +50,10 @@ ECase. Exp ::= "case" Exp "of" "{" [Case] "}" ;
|
||||
Case. Case ::= Pattern "|" Exp "->" Exp ;
|
||||
separator Case ";" ;
|
||||
|
||||
|
||||
-- Lambda abstractions.
|
||||
EAbs. Exp2 ::= "\\" PatternVariable "->" Exp ;
|
||||
EAbs. Exp1 ::= "\\" PatternVariable "->" Exp ;
|
||||
-- Function types.
|
||||
EPi. Exp2 ::= "(" PatternVariable ":" Exp ")" "->" Exp ;
|
||||
EPi. Exp1 ::= "(" PatternVariable ":" Exp ")" "->" Exp ;
|
||||
|
||||
-- Function application.
|
||||
EApp. Exp3 ::= Exp3 Exp4 ;
|
||||
|
||||
@@ -139,7 +139,7 @@ All other symbols are terminals.\\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{LetDef}} & {\arrow} &{\nonterminal{CIdent}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
{\nonterminal{LetDef}} & {\arrow} &{\nonterminal{CIdent}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
@@ -159,9 +159,9 @@ All other symbols are terminals.\\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp2}} & {\arrow} &{\terminal{$\backslash$}} {\nonterminal{PatternVariable}} {\terminal{{$-$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
{\nonterminal{Exp1}} & {\arrow} &{\terminal{$\backslash$}} {\nonterminal{PatternVariable}} {\terminal{{$-$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\terminal{(}} {\nonterminal{PatternVariable}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{)}} {\terminal{{$-$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{Exp3}} \\
|
||||
& {\delimit} &{\nonterminal{Exp2}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
@@ -207,7 +207,7 @@ All other symbols are terminals.\\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp1}} & {\arrow} &{\nonterminal{Exp2}} \\
|
||||
{\nonterminal{Exp2}} & {\arrow} &{\nonterminal{Exp3}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
|
||||
|
||||
@@ -195,19 +195,19 @@ happyOutTok x = unsafeCoerce# x
|
||||
{-# INLINE happyOutTok #-}
|
||||
|
||||
happyActOffsets :: HappyAddr
|
||||
happyActOffsets = HappyA# "\x15\x00\x73\x01\xd5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x00\x00\x00\x90\x01\xe0\x00\x00\x00\x00\x00\x5e\x01\x09\x00\x00\x00\x73\x01\xdf\x00\xde\x00\xdd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x35\x00\xbd\x00\x00\x00\xd7\x00\xc9\x00\xd0\x00\x15\x00\x73\x01\x73\x01\xc0\x00\xc0\x00\xc0\x00\xbe\x00\x00\x00\xc7\x00\x00\x00\x88\x01\xcd\x00\xc6\x00\xab\x00\xbb\x00\x73\x01\x00\x00\x00\x00\x73\x01\x73\x01\xc3\x00\xc2\x00\xbc\x00\xb8\x00\xb6\x00\xb9\x00\xaf\x00\xb2\x00\xb1\x00\x9d\x00\x00\x00\x00\x00\x00\x00\x73\x01\x95\x00\x00\x00\x8f\x00\x73\x01\x00\x00\x8f\x00\x73\x01\x90\x00\x85\x00\x73\x01\xad\x01\x00\x00\x97\x00\x8c\x00\x00\x00\x00\x00\x8e\x00\x00\x00\x8d\x00\x91\x00\x7a\x00\x00\x00\x8a\x00\x87\x00\x00\x00\x73\x01\x00\x00\x00\x00\x00\x00\x00\x00\x81\x00\x69\x00\x00\x00\x73\x01\x69\x00\x00\x00\x00\x00\xad\x01\x73\x01\x73\x01\x00\x00\x71\x00\x00\x00\xa5\x01\x75\x00\x78\x00\x74\x00\x00\x00\x6d\x00\x65\x00\x5c\x00\x00\x00\x43\x00\x73\x01\x00\x00\x43\x00\xad\x01\x00\x00\x00\x00\x73\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
||||
happyActOffsets = HappyA# "\x15\x00\x5f\x01\xcd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x00\x00\x00\x7c\x01\xde\x00\x00\x00\x00\x00\x4a\x01\x09\x00\x00\x00\x5f\x01\xdf\x00\xd7\x00\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x35\x00\xbc\x00\x00\x00\xd1\x00\xc7\x00\xcf\x00\x15\x00\x5f\x01\x5f\x01\xc6\x00\xc6\x00\xc6\x00\xbe\x00\x00\x00\xc5\x00\x00\x00\x74\x01\xcb\x00\xc0\x00\xac\x00\xb9\x00\x5f\x01\x00\x00\x00\x00\x5f\x01\x5f\x01\xc1\x00\xb8\x00\xbb\x00\xb7\x00\xb5\x00\xb3\x00\xaf\x00\xb0\x00\xa9\x00\x9d\x00\x00\x00\x00\x00\x00\x00\x5f\x01\x94\x00\x00\x00\x86\x00\x5f\x01\x00\x00\x86\x00\x5f\x01\x8f\x00\x84\x00\x5f\x01\x99\x01\x00\x00\x90\x00\x8b\x00\x00\x00\x00\x00\x8d\x00\x00\x00\x8c\x00\x8a\x00\x7a\x00\x00\x00\x89\x00\x00\x00\x00\x00\x5f\x01\x00\x00\x00\x00\x00\x00\x00\x00\x81\x00\x69\x00\x00\x00\x69\x00\x00\x00\x00\x00\x99\x01\x5f\x01\x5f\x01\x00\x00\x71\x00\x00\x00\x91\x01\x75\x00\x78\x00\x74\x00\x6d\x00\x65\x00\x5c\x00\x00\x00\x43\x00\x5f\x01\x00\x00\x43\x00\x99\x01\x00\x00\x00\x00\x5f\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
||||
|
||||
happyGotoOffsets :: HappyAddr
|
||||
happyGotoOffsets = HappyA# "\x4e\x00\x3a\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x57\x01\x00\x00\x00\x00\x00\x00\x01\x00\x04\x00\x00\x00\x31\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\x00\x00\x00\x6a\x00\x14\x01\x0b\x01\x28\x00\x44\x00\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x00\x00\x00\xee\x00\x00\x00\x00\x00\xe5\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbf\x00\x00\x00\x00\x00\x02\x00\xa2\x00\x00\x00\x1e\x00\x99\x00\x00\x00\x03\x00\x7c\x00\xc9\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa3\x00\x00\x00\x56\x00\x3e\x00\xff\xff\x00\x00\xbd\x01\x4d\x00\x30\x00\x00\x00\x00\x00\x00\x00\xd2\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x27\x00\x00\x00\x21\x00\x5c\x01\x00\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
||||
happyGotoOffsets = HappyA# "\x4e\x00\x31\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x01\x00\x00\x00\x00\x00\x00\x01\x00\x04\x00\x00\x00\x14\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\x00\x00\x00\x6a\x00\x0b\x01\xee\x00\x28\x00\x44\x00\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x00\x00\x00\xe5\x00\x00\x00\x00\x00\xc8\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\x00\x00\x00\x00\x00\x02\x00\x99\x00\x00\x00\x1e\x00\x7c\x00\x00\x00\x03\x00\x73\x00\xb5\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x56\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa3\x00\x00\x00\x3e\x00\xff\xff\x00\x00\xa9\x01\x4d\x00\x30\x00\x00\x00\x00\x00\x00\x00\xbe\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7d\x00\x27\x00\x00\x00\x21\x00\x3e\x01\x00\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
||||
|
||||
happyDefActions :: HappyAddr
|
||||
happyDefActions = HappyA# "\xf7\xff\x00\x00\x00\x00\xfd\xff\xc9\xff\xc8\xff\xc7\xff\xc6\xff\xcb\xff\x00\x00\xbc\xff\xd2\xff\xd0\xff\xce\xff\xdd\xff\x00\x00\x00\x00\xca\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xfb\xff\xfa\xff\xf9\xff\x00\x00\x00\x00\xf8\xff\xf6\xff\x00\x00\x00\x00\xf7\xff\x00\x00\x00\x00\xc3\xff\xbf\xff\xdb\xff\x00\x00\xe1\xff\x00\x00\xe0\xff\xe1\xff\x00\x00\x00\x00\x00\x00\xd1\xff\x00\x00\xcf\xff\xc5\xff\x00\x00\x00\x00\x00\x00\x00\x00\xda\xff\x00\x00\x00\x00\xbe\xff\x00\x00\x00\x00\xc2\xff\x00\x00\xf2\xff\xf3\xff\xf5\xff\x00\x00\x00\x00\xcd\xff\xc3\xff\x00\x00\xcc\xff\xbf\xff\x00\x00\x00\x00\xdb\xff\x00\x00\xd7\xff\xd4\xff\x00\x00\x00\x00\xe7\xff\xe6\xff\x00\x00\xea\xff\xd6\xff\x00\x00\x00\x00\xe8\xff\x00\x00\x00\x00\xd9\xff\x00\x00\xc0\xff\xbd\xff\xc4\xff\xc1\xff\x00\x00\xf0\xff\xdf\xff\x00\x00\xe4\xff\xed\xff\xde\xff\xd7\xff\x00\x00\x00\x00\xd3\xff\x00\x00\xd5\xff\x00\x00\x00\x00\xe3\xff\x00\x00\xdc\xff\x00\x00\xef\xff\x00\x00\xf4\xff\xf0\xff\x00\x00\xe9\xff\xe4\xff\x00\x00\xec\xff\xeb\xff\x00\x00\xd8\xff\xe5\xff\xe2\xff\xf1\xff\xee\xff"#
|
||||
happyDefActions = HappyA# "\xf7\xff\x00\x00\x00\x00\xfd\xff\xc9\xff\xc8\xff\xc7\xff\xc6\xff\xcb\xff\x00\x00\xdd\xff\xbc\xff\xd0\xff\xce\xff\xd2\xff\x00\x00\x00\x00\xca\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xfb\xff\xfa\xff\xf9\xff\x00\x00\x00\x00\xf8\xff\xf6\xff\x00\x00\x00\x00\xf7\xff\x00\x00\x00\x00\xc3\xff\xbf\xff\xdb\xff\x00\x00\xe1\xff\x00\x00\xe0\xff\xe1\xff\x00\x00\x00\x00\x00\x00\xd1\xff\x00\x00\xcf\xff\xc5\xff\x00\x00\x00\x00\x00\x00\x00\x00\xda\xff\x00\x00\x00\x00\xbe\xff\x00\x00\x00\x00\xc2\xff\x00\x00\xf2\xff\xf3\xff\xf5\xff\x00\x00\x00\x00\xcd\xff\xc3\xff\x00\x00\xcc\xff\xbf\xff\x00\x00\x00\x00\xdb\xff\x00\x00\xd7\xff\xd4\xff\x00\x00\x00\x00\xe7\xff\xe6\xff\x00\x00\xea\xff\xd6\xff\x00\x00\x00\x00\xe8\xff\x00\x00\xdc\xff\xd9\xff\x00\x00\xc0\xff\xbd\xff\xc4\xff\xc1\xff\x00\x00\xf0\xff\xdf\xff\xe4\xff\xed\xff\xde\xff\xd7\xff\x00\x00\x00\x00\xd3\xff\x00\x00\xd5\xff\x00\x00\x00\x00\xe3\xff\x00\x00\x00\x00\xef\xff\x00\x00\xf4\xff\xf0\xff\x00\x00\xe9\xff\xe4\xff\x00\x00\xec\xff\xeb\xff\x00\x00\xd8\xff\xe5\xff\xe2\xff\xf1\xff\xee\xff"#
|
||||
|
||||
happyCheck :: HappyAddr
|
||||
happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x04\x00\x04\x00\x0a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x0e\x00\x0f\x00\x08\x00\x0e\x00\x10\x00\x11\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x18\x00\x19\x00\x04\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x04\x00\x1a\x00\x0f\x00\x04\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0c\x00\x0d\x00\x1a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x02\x00\x1a\x00\x1b\x00\x05\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x18\x00\x19\x00\x04\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x04\x00\x04\x00\x0c\x00\x0d\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x05\x00\x06\x00\x07\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x1a\x00\x1a\x00\x1b\x00\x04\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x01\x00\x10\x00\x11\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x04\x00\x02\x00\x06\x00\x07\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x01\x00\x05\x00\x0a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x1a\x00\x03\x00\x08\x00\x09\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x05\x00\x03\x00\x01\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x1a\x00\x04\x00\x0a\x00\x09\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x07\x00\x1a\x00\x10\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x1a\x00\x15\x00\x08\x00\x09\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x01\x00\x04\x00\x02\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x01\x00\x05\x00\x04\x00\x01\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x02\x00\x1a\x00\x03\x00\x0c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x07\x00\x0f\x00\x02\x00\x12\x00\x0a\x00\x02\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x01\x00\x1c\x00\x1a\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x03\x00\x03\x00\x03\x00\x1a\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x1c\x00\x16\x00\x0c\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x00\x00\x01\x00\xff\xff\xff\xff\x04\x00\xff\xff\xff\xff\xff\xff\x06\x00\xff\xff\x08\x00\x0b\x00\xff\xff\x0b\x00\x0e\x00\x0d\x00\x0e\x00\x16\x00\x17\x00\x11\x00\xff\xff\x13\x00\x14\x00\xff\xff\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\xff\xff\x0d\x00\x0e\x00\xff\xff\xff\xff\x11\x00\xff\xff\x13\x00\x14\x00\xff\xff\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x06\x00\x07\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0c\x00\x0d\x00\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\x0d\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x13\x00\x14\x00\xff\xff\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x06\x00\x07\x00\x08\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x06\x00\xff\xff\x08\x00\xff\xff\xff\xff\x13\x00\xff\xff\x0d\x00\x16\x00\x17\x00\x00\x00\x01\x00\x1a\x00\x13\x00\x04\x00\xff\xff\x16\x00\x17\x00\xff\xff\xff\xff\x1a\x00\x0b\x00\x00\x00\x01\x00\x0e\x00\xff\xff\x04\x00\xff\xff\x12\x00\x13\x00\xff\xff\x00\x00\x01\x00\x0b\x00\xff\xff\x04\x00\x0e\x00\xff\xff\xff\xff\xff\xff\x12\x00\x13\x00\x0b\x00\xff\xff\xff\xff\x0e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
|
||||
happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x04\x00\x04\x00\x0a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x0e\x00\x0f\x00\x08\x00\x0e\x00\x10\x00\x11\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x18\x00\x19\x00\x04\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x04\x00\x1a\x00\x0f\x00\x04\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0c\x00\x0d\x00\x1a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x02\x00\x1a\x00\x1b\x00\x05\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x18\x00\x19\x00\x04\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x04\x00\x04\x00\x0c\x00\x0d\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x05\x00\x06\x00\x07\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x1a\x00\x1a\x00\x1b\x00\x04\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x01\x00\x10\x00\x11\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x04\x00\x02\x00\x06\x00\x07\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x01\x00\x05\x00\x0a\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x1a\x00\x03\x00\x08\x00\x09\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x03\x00\x01\x00\x04\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x1a\x00\x0a\x00\x09\x00\x07\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x1a\x00\x10\x00\x1a\x00\x04\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x04\x00\x0f\x00\x15\x00\x01\x00\x08\x00\x09\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x02\x00\x04\x00\x01\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x05\x00\x04\x00\x01\x00\x05\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x03\x00\x0c\x00\x1a\x00\x07\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x02\x00\x0f\x00\x0a\x00\x12\x00\x02\x00\x01\x00\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\x1c\x00\x03\x00\x03\x00\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\x1a\x00\x1a\x00\x03\x00\x16\x00\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x0c\x00\xff\xff\x1c\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x14\x00\x15\x00\x16\x00\x17\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x1c\x00\x14\x00\x15\x00\x16\x00\x17\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\xff\xff\x00\x00\x01\x00\x0f\x00\xff\xff\x04\x00\xff\xff\xff\xff\x14\x00\x15\x00\x16\x00\x17\x00\x0b\x00\xff\xff\xff\xff\x0e\x00\x1c\x00\x16\x00\x17\x00\x06\x00\xff\xff\x08\x00\xff\xff\xff\xff\x0b\x00\xff\xff\x0d\x00\x0e\x00\xff\xff\xff\xff\x11\x00\xff\xff\x13\x00\x14\x00\xff\xff\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\xff\xff\x0d\x00\x0e\x00\xff\xff\xff\xff\x11\x00\xff\xff\x13\x00\x14\x00\xff\xff\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x06\x00\x07\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0c\x00\x0d\x00\x06\x00\xff\xff\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\x0d\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x13\x00\x14\x00\xff\xff\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x06\x00\x07\x00\x08\x00\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x06\x00\xff\xff\x08\x00\xff\xff\xff\xff\x13\x00\xff\xff\x0d\x00\x16\x00\x17\x00\x00\x00\x01\x00\x1a\x00\x13\x00\x04\x00\xff\xff\x16\x00\x17\x00\xff\xff\xff\xff\x1a\x00\x0b\x00\x00\x00\x01\x00\x0e\x00\xff\xff\x04\x00\xff\xff\x12\x00\x13\x00\xff\xff\x00\x00\x01\x00\x0b\x00\xff\xff\x04\x00\x0e\x00\xff\xff\xff\xff\xff\xff\x12\x00\x13\x00\x0b\x00\xff\xff\xff\xff\x0e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
|
||||
|
||||
happyTable :: HappyAddr
|
||||
happyTable = HappyA# "\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x2a\x00\x3b\x00\x35\x00\x27\x00\x6d\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x2b\x00\x2c\x00\x2a\x00\x28\x00\x36\x00\x5a\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x7e\x00\x3c\x00\x5f\x00\x65\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x38\x00\x1a\x00\x1f\x00\x6e\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x3b\x00\x6f\x00\x80\x00\x1a\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x30\x00\x81\x00\x22\x00\x39\x00\x5d\x00\x23\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x6a\x00\x3c\x00\x3d\x00\x6e\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x38\x00\x1f\x00\x6f\x00\x70\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x35\x00\x6b\x00\x1a\x00\x39\x00\x3a\x00\x76\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x71\x00\x77\x00\x36\x00\x37\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x1a\x00\x78\x00\x40\x00\x1d\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x79\x00\x7a\x00\x7b\x00\x7e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x72\x00\x62\x00\x1a\x00\x62\x00\x73\x00\x82\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x59\x00\x64\x00\x65\x00\x68\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x1a\x00\x67\x00\x6a\x00\x69\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x50\x00\x1a\x00\x5c\x00\x44\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x72\x00\x5c\x00\x1a\x00\x61\x00\x73\x00\x74\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x5e\x00\x45\x00\x47\x00\x46\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x4c\x00\x1a\x00\x4d\x00\x2e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x32\x00\x42\x00\x33\x00\x35\x00\x34\x00\x42\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x4d\x00\x21\x00\xff\xff\x1a\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x24\x00\x25\x00\x26\x00\x1a\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\xff\xff\x04\x00\x2e\x00\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x2c\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x3e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x09\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x50\x00\x51\x00\x00\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x2a\x00\x7f\x00\x00\x00\x11\x00\x53\x00\x12\x00\x13\x00\x2e\x00\x0d\x00\x14\x00\x00\x00\x15\x00\x16\x00\x00\x00\x04\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x12\x00\x13\x00\x00\x00\x00\x00\x14\x00\x00\x00\x15\x00\x16\x00\x00\x00\x04\x00\x17\x00\x18\x00\x19\x00\x1a\x00\xcb\xff\xcb\xff\x00\x00\x00\x00\x00\x00\x00\x00\xcb\xff\xcb\xff\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcb\xff\xcb\xff\x12\x00\xcb\xff\xcb\xff\xcb\xff\xcb\xff\xcb\xff\x15\x00\x16\x00\x00\x00\x04\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x57\x00\x7d\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x00\x57\x00\x00\x00\x2a\x00\x00\x00\x00\x00\x59\x00\x00\x00\x58\x00\x04\x00\x17\x00\x50\x00\x51\x00\x1a\x00\x59\x00\x27\x00\x00\x00\x04\x00\x17\x00\x00\x00\x00\x00\x1a\x00\x52\x00\x50\x00\x51\x00\x53\x00\x00\x00\x27\x00\x00\x00\x54\x00\x6c\x00\x00\x00\x50\x00\x51\x00\x52\x00\x00\x00\x27\x00\x53\x00\x00\x00\x00\x00\x00\x00\x54\x00\x55\x00\x7b\x00\x00\x00\x00\x00\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
||||
happyTable = HappyA# "\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x2a\x00\x3b\x00\x35\x00\x27\x00\x6c\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x2b\x00\x2c\x00\x2a\x00\x28\x00\x36\x00\x5a\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x7c\x00\x3c\x00\x5f\x00\x64\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x38\x00\x1a\x00\x1f\x00\x6d\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x3b\x00\x6e\x00\x7e\x00\x1a\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x30\x00\x7f\x00\x22\x00\x39\x00\x5d\x00\x23\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x69\x00\x3c\x00\x3d\x00\x6d\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x38\x00\x1f\x00\x6e\x00\x6f\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x35\x00\x6a\x00\x1a\x00\x39\x00\x3a\x00\x74\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x62\x00\x75\x00\x36\x00\x37\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x1a\x00\x76\x00\x40\x00\x1d\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x77\x00\x78\x00\x79\x00\x7c\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x70\x00\x59\x00\x1a\x00\x62\x00\x71\x00\x80\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x5c\x00\x64\x00\x67\x00\x66\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x1a\x00\x69\x00\x68\x00\x50\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x1a\x00\x5c\x00\x1a\x00\x44\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x70\x00\x5e\x00\x61\x00\x45\x00\x71\x00\x72\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x42\x00\x46\x00\x47\x00\x48\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x4d\x00\x2e\x00\x1a\x00\x32\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x33\x00\x4d\x00\x34\x00\x35\x00\x42\x00\x21\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x4e\x00\xff\xff\x24\x00\x25\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x1a\x00\x1a\x00\x26\x00\x04\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x2e\x00\x00\x00\xff\xff\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x3e\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x26\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x00\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x50\x00\x51\x00\x09\x00\x00\x00\x27\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x7d\x00\x00\x00\x00\x00\x53\x00\x0e\x00\x2e\x00\x0d\x00\x10\x00\x00\x00\x2a\x00\x00\x00\x00\x00\x11\x00\x00\x00\x12\x00\x13\x00\x00\x00\x00\x00\x14\x00\x00\x00\x15\x00\x16\x00\x00\x00\x04\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x12\x00\x13\x00\x00\x00\x00\x00\x14\x00\x00\x00\x15\x00\x16\x00\x00\x00\x04\x00\x17\x00\x18\x00\x19\x00\x1a\x00\xcb\xff\xcb\xff\x00\x00\x00\x00\x00\x00\x00\x00\xcb\xff\xcb\xff\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcb\xff\xcb\xff\x12\x00\xcb\xff\xcb\xff\xcb\xff\xcb\xff\xcb\xff\x15\x00\x16\x00\x00\x00\x04\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x57\x00\x7b\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x00\x57\x00\x00\x00\x2a\x00\x00\x00\x00\x00\x59\x00\x00\x00\x58\x00\x04\x00\x17\x00\x50\x00\x51\x00\x1a\x00\x59\x00\x27\x00\x00\x00\x04\x00\x17\x00\x00\x00\x00\x00\x1a\x00\x52\x00\x50\x00\x51\x00\x53\x00\x00\x00\x27\x00\x00\x00\x54\x00\x6b\x00\x00\x00\x50\x00\x51\x00\x52\x00\x00\x00\x27\x00\x53\x00\x00\x00\x00\x00\x00\x00\x54\x00\x55\x00\x79\x00\x00\x00\x00\x00\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
||||
|
||||
happyReduceArr = array (2, 67) [
|
||||
(2 , happyReduce_2),
|
||||
@@ -553,24 +553,20 @@ happyReduction_33 (happy_x_6 `HappyStk`
|
||||
|
||||
happyReduce_34 = happySpecReduce_1 15# happyReduction_34
|
||||
happyReduction_34 happy_x_1
|
||||
= case happyOut33 happy_x_1 of { happy_var_1 ->
|
||||
= case happyOut25 happy_x_1 of { happy_var_1 ->
|
||||
happyIn20
|
||||
(happy_var_1
|
||||
)}
|
||||
|
||||
happyReduce_35 = happyReduce 5# 16# happyReduction_35
|
||||
happyReduction_35 (happy_x_5 `HappyStk`
|
||||
happy_x_4 `HappyStk`
|
||||
happy_x_3 `HappyStk`
|
||||
happy_x_2 `HappyStk`
|
||||
happy_x_1 `HappyStk`
|
||||
happyRest)
|
||||
= case happyOut9 happy_x_1 of { happy_var_1 ->
|
||||
happyReduce_35 = happySpecReduce_3 16# happyReduction_35
|
||||
happyReduction_35 happy_x_3
|
||||
happy_x_2
|
||||
happy_x_1
|
||||
= case happyOut9 happy_x_1 of { happy_var_1 ->
|
||||
case happyOut20 happy_x_3 of { happy_var_3 ->
|
||||
case happyOut20 happy_x_5 of { happy_var_5 ->
|
||||
happyIn21
|
||||
(LetDef happy_var_1 happy_var_3 happy_var_5
|
||||
) `HappyStk` happyRest}}}
|
||||
(LetDef happy_var_1 happy_var_3
|
||||
)}}
|
||||
|
||||
happyReduce_36 = happySpecReduce_0 17# happyReduction_36
|
||||
happyReduction_36 = happyIn22
|
||||
@@ -660,7 +656,7 @@ happyReduction_44 (happy_x_7 `HappyStk`
|
||||
|
||||
happyReduce_45 = happySpecReduce_1 20# happyReduction_45
|
||||
happyReduction_45 happy_x_1
|
||||
= case happyOut26 happy_x_1 of { happy_var_1 ->
|
||||
= case happyOut33 happy_x_1 of { happy_var_1 ->
|
||||
happyIn25
|
||||
(happy_var_1
|
||||
)}
|
||||
@@ -836,7 +832,7 @@ happyReduction_66 happy_x_3
|
||||
|
||||
happyReduce_67 = happySpecReduce_1 28# happyReduction_67
|
||||
happyReduction_67 happy_x_1
|
||||
= case happyOut25 happy_x_1 of { happy_var_1 ->
|
||||
= case happyOut26 happy_x_1 of { happy_var_1 ->
|
||||
happyIn33
|
||||
(happy_var_1
|
||||
)}
|
||||
|
||||
@@ -114,7 +114,7 @@ Exp : 'let' '{' ListLetDef '}' 'in' Exp { ELet $3 $6 }
|
||||
|
||||
|
||||
LetDef :: { LetDef }
|
||||
LetDef : CIdent ':' Exp '=' Exp { LetDef $1 $3 $5 }
|
||||
LetDef : CIdent '=' Exp { LetDef $1 $3 }
|
||||
|
||||
|
||||
ListLetDef :: { [LetDef] }
|
||||
@@ -133,10 +133,10 @@ ListCase : {- empty -} { [] }
|
||||
| Case ';' ListCase { (:) $1 $3 }
|
||||
|
||||
|
||||
Exp2 :: { Exp }
|
||||
Exp2 : '\\' PatternVariable '->' Exp { EAbs $2 $4 }
|
||||
Exp1 :: { Exp }
|
||||
Exp1 : '\\' PatternVariable '->' Exp { EAbs $2 $4 }
|
||||
| '(' PatternVariable ':' Exp ')' '->' Exp { EPi $2 $4 $7 }
|
||||
| Exp3 { $1 }
|
||||
| Exp2 { $1 }
|
||||
|
||||
|
||||
Exp3 :: { Exp }
|
||||
@@ -181,8 +181,8 @@ ListFieldValue : {- empty -} { [] }
|
||||
| FieldValue ';' ListFieldValue { (:) $1 $3 }
|
||||
|
||||
|
||||
Exp1 :: { Exp }
|
||||
Exp1 : Exp2 { $1 }
|
||||
Exp2 :: { Exp }
|
||||
Exp2 : Exp3 { $1 }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -96,8 +96,8 @@ instance Print (Tree c) where
|
||||
PVWild -> prPrec _i 0 (concatD [doc (showString "_")])
|
||||
ELet letdefs exp -> prPrec _i 0 (concatD [doc (showString "let") , doc (showString "{") , prt 0 letdefs , doc (showString "}") , doc (showString "in") , prt 0 exp])
|
||||
ECase exp cases -> prPrec _i 0 (concatD [doc (showString "case") , prt 0 exp , doc (showString "of") , doc (showString "{") , prt 0 cases , doc (showString "}")])
|
||||
EAbs patternvariable exp -> prPrec _i 2 (concatD [doc (showString "\\") , prt 0 patternvariable , doc (showString "->") , prt 0 exp])
|
||||
EPi patternvariable exp0 exp1 -> prPrec _i 2 (concatD [doc (showString "(") , prt 0 patternvariable , doc (showString ":") , prt 0 exp0 , doc (showString ")") , doc (showString "->") , prt 0 exp1])
|
||||
EAbs patternvariable exp -> prPrec _i 1 (concatD [doc (showString "\\") , prt 0 patternvariable , doc (showString "->") , prt 0 exp])
|
||||
EPi patternvariable exp0 exp1 -> prPrec _i 1 (concatD [doc (showString "(") , prt 0 patternvariable , doc (showString ":") , prt 0 exp0 , doc (showString ")") , doc (showString "->") , prt 0 exp1])
|
||||
EApp exp0 exp1 -> prPrec _i 3 (concatD [prt 3 exp0 , prt 4 exp1])
|
||||
EProj exp cident -> prPrec _i 4 (concatD [prt 4 exp , doc (showString ".") , prt 0 cident])
|
||||
ERecType fieldtypes -> prPrec _i 5 (concatD [doc (showString "sig") , doc (showString "{") , prt 0 fieldtypes , doc (showString "}")])
|
||||
@@ -108,7 +108,7 @@ instance Print (Tree c) where
|
||||
EInteger n -> prPrec _i 5 (concatD [prt 0 n])
|
||||
EDouble d -> prPrec _i 5 (concatD [prt 0 d])
|
||||
EMeta tmeta -> prPrec _i 5 (concatD [prt 0 tmeta])
|
||||
LetDef cident exp0 exp1 -> prPrec _i 0 (concatD [prt 0 cident , doc (showString ":") , prt 0 exp0 , doc (showString "=") , prt 0 exp1])
|
||||
LetDef cident exp -> prPrec _i 0 (concatD [prt 0 cident , doc (showString "=") , prt 0 exp])
|
||||
Case pattern exp0 exp1 -> prPrec _i 0 (concatD [prt 0 pattern , doc (showString "|") , prt 0 exp0 , doc (showString "->") , prt 0 exp1])
|
||||
FieldType cident exp -> prPrec _i 0 (concatD [prt 0 cident , doc (showString ":") , prt 0 exp])
|
||||
FieldValue cident exp -> prPrec _i 0 (concatD [prt 0 cident , doc (showString "=") , prt 0 exp])
|
||||
|
||||
@@ -39,7 +39,7 @@ transTree t = case t of
|
||||
EInteger n -> failure t
|
||||
EDouble d -> failure t
|
||||
EMeta tmeta -> failure t
|
||||
LetDef cident exp0 exp1 -> failure t
|
||||
LetDef cident exp -> failure t
|
||||
Case pattern exp0 exp1 -> failure t
|
||||
FieldType cident exp -> failure t
|
||||
FieldValue cident exp -> failure t
|
||||
@@ -97,7 +97,7 @@ transExp t = case t of
|
||||
|
||||
transLetDef :: LetDef -> Result
|
||||
transLetDef t = case t of
|
||||
LetDef cident exp0 exp1 -> failure t
|
||||
LetDef cident exp -> failure t
|
||||
|
||||
transCase :: Case -> Result
|
||||
transCase t = case t of
|
||||
|
||||
@@ -131,8 +131,8 @@ addModuleEnv env (Module ds) =
|
||||
eval :: Env -> Exp -> Value
|
||||
eval env x = case x of
|
||||
ELet defs exp2 ->
|
||||
let env' = [ (id, v) | LetDef id _ e <- defs,
|
||||
let v = eval env' e]
|
||||
let env' = [ (id, v) | LetDef id e <- defs,
|
||||
let v = eval env' e]
|
||||
`addToEnv` env
|
||||
in eval (seqEnv env') exp2
|
||||
ECase exp cases ->
|
||||
|
||||
@@ -103,7 +103,7 @@ data Tree :: * -> * where
|
||||
EMeta :: Tree Exp_
|
||||
VVar :: Ident -> Tree VarOrWild_
|
||||
VWild :: Tree VarOrWild_
|
||||
LetDef :: Ident -> Exp -> Exp -> Tree LetDef_
|
||||
LetDef :: Ident -> Exp -> Tree LetDef_
|
||||
Case :: Pattern -> Guard -> Exp -> Tree Case_
|
||||
BindVar :: VarOrWild -> Exp -> Tree Bind_
|
||||
BindNoVar :: Exp -> Tree Bind_
|
||||
@@ -175,7 +175,7 @@ composOpM f t = case t of
|
||||
ETuple exp exps -> return ETuple `ap` f exp `ap` mapM f exps
|
||||
EVar i -> return EVar `ap` f i
|
||||
VVar i -> return VVar `ap` f i
|
||||
LetDef i exp0 exp1 -> return LetDef `ap` f i `ap` f exp0 `ap` f exp1
|
||||
LetDef i exp -> return LetDef `ap` f i `ap` f exp
|
||||
Case pattern guard exp -> return Case `ap` f pattern `ap` f guard `ap` f exp
|
||||
BindVar varorwild exp -> return BindVar `ap` f varorwild `ap` f exp
|
||||
BindNoVar exp -> return BindNoVar `ap` f exp
|
||||
@@ -235,7 +235,7 @@ composOpFold zero combine f t = case t of
|
||||
ETuple exp exps -> f exp `combine` foldr combine zero (map f exps)
|
||||
EVar i -> f i
|
||||
VVar i -> f i
|
||||
LetDef i exp0 exp1 -> f i `combine` f exp0 `combine` f exp1
|
||||
LetDef i exp -> f i `combine` f exp
|
||||
Case pattern guard exp -> f pattern `combine` f guard `combine` f exp
|
||||
BindVar varorwild exp -> f varorwild `combine` f exp
|
||||
BindNoVar exp -> f exp
|
||||
@@ -308,7 +308,7 @@ instance Show (Tree c) where
|
||||
EMeta -> showString "EMeta"
|
||||
VVar i -> opar n . showString "VVar" . showChar ' ' . showsPrec 1 i . cpar n
|
||||
VWild -> showString "VWild"
|
||||
LetDef i exp0 exp1 -> opar n . showString "LetDef" . showChar ' ' . showsPrec 1 i . showChar ' ' . showsPrec 1 exp0 . showChar ' ' . showsPrec 1 exp1 . cpar n
|
||||
LetDef i exp -> opar n . showString "LetDef" . showChar ' ' . showsPrec 1 i . showChar ' ' . showsPrec 1 exp . cpar n
|
||||
Case pattern guard exp -> opar n . showString "Case" . showChar ' ' . showsPrec 1 pattern . showChar ' ' . showsPrec 1 guard . showChar ' ' . showsPrec 1 exp . cpar n
|
||||
BindVar varorwild exp -> opar n . showString "BindVar" . showChar ' ' . showsPrec 1 varorwild . showChar ' ' . showsPrec 1 exp . cpar n
|
||||
BindNoVar exp -> opar n . showString "BindNoVar" . showChar ' ' . showsPrec 1 exp . cpar n
|
||||
@@ -384,7 +384,7 @@ johnMajorEq (EDouble d) (EDouble d_) = d == d_
|
||||
johnMajorEq EMeta EMeta = True
|
||||
johnMajorEq (VVar i) (VVar i_) = i == i_
|
||||
johnMajorEq VWild VWild = True
|
||||
johnMajorEq (LetDef i exp0 exp1) (LetDef i_ exp0_ exp1_) = i == i_ && exp0 == exp0_ && exp1 == exp1_
|
||||
johnMajorEq (LetDef i exp) (LetDef i_ exp_) = i == i_ && exp == exp_
|
||||
johnMajorEq (Case pattern guard exp) (Case pattern_ guard_ exp_) = pattern == pattern_ && guard == guard_ && exp == exp_
|
||||
johnMajorEq (BindVar varorwild exp) (BindVar varorwild_ exp_) = varorwild == varorwild_ && exp == exp_
|
||||
johnMajorEq (BindNoVar exp) (BindNoVar exp_) = exp == exp_
|
||||
@@ -459,7 +459,7 @@ instance Ord (Tree c) where
|
||||
index (EMeta ) = 60
|
||||
index (VVar _) = 61
|
||||
index (VWild ) = 62
|
||||
index (LetDef _ _ _) = 63
|
||||
index (LetDef _ _) = 63
|
||||
index (Case _ _ _) = 64
|
||||
index (BindVar _ _) = 65
|
||||
index (BindNoVar _) = 66
|
||||
@@ -529,7 +529,7 @@ instance Ord (Tree c) where
|
||||
compareSame EMeta EMeta = EQ
|
||||
compareSame (VVar i) (VVar i_) = compare i i_
|
||||
compareSame VWild VWild = EQ
|
||||
compareSame (LetDef i exp0 exp1) (LetDef i_ exp0_ exp1_) = mappend (compare i i_) (mappend (compare exp0 exp0_) (compare exp1 exp1_))
|
||||
compareSame (LetDef i exp) (LetDef i_ exp_) = mappend (compare i i_) (compare exp exp_)
|
||||
compareSame (Case pattern guard exp) (Case pattern_ guard_ exp_) = mappend (compare pattern pattern_) (mappend (compare guard guard_) (compare exp exp_))
|
||||
compareSame (BindVar varorwild exp) (BindVar varorwild_ exp_) = mappend (compare varorwild varorwild_) (compare exp exp_)
|
||||
compareSame (BindNoVar exp) (BindNoVar exp_) = compare exp exp_
|
||||
|
||||
@@ -196,7 +196,7 @@ All other symbols are terminals.\\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{LetDef}} & {\arrow} &{\nonterminal{Ident}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
{\nonterminal{LetDef}} & {\arrow} &{\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -190,7 +190,7 @@ Exp1 : '\\' VarOrWild '->' Exp1 { EAbs $2 $4 }
|
||||
|
||||
|
||||
LetDef :: { LetDef }
|
||||
LetDef : Ident ':' Exp '=' Exp { LetDef $1 $3 $5 }
|
||||
LetDef : Ident '=' Exp { LetDef $1 $3 }
|
||||
|
||||
|
||||
ListLetDef :: { [LetDef] }
|
||||
|
||||
@@ -143,7 +143,7 @@ instance Print (Tree c) where
|
||||
EMeta -> prPrec _i 13 (concatD [doc (showString "?")])
|
||||
VVar i -> prPrec _i 0 (concatD [prt 0 i])
|
||||
VWild -> prPrec _i 0 (concatD [doc (showString "_")])
|
||||
LetDef i exp0 exp1 -> prPrec _i 0 (concatD [prt 0 i , doc (showString ":") , prt 0 exp0 , doc (showString "=") , prt 0 exp1])
|
||||
LetDef i exp -> prPrec _i 0 (concatD [prt 0 i , doc (showString "=") , prt 0 exp])
|
||||
Case pattern guard exp -> prPrec _i 0 (concatD [prt 0 pattern , prt 0 guard , doc (showString "->") , prt 0 exp])
|
||||
BindVar varorwild exp -> prPrec _i 0 (concatD [prt 0 varorwild , doc (showString "<-") , prt 0 exp])
|
||||
BindNoVar exp -> prPrec _i 0 (concatD [prt 0 exp])
|
||||
|
||||
@@ -74,7 +74,7 @@ transTree t = case t of
|
||||
EMeta -> failure t
|
||||
VVar i -> failure t
|
||||
VWild -> failure t
|
||||
LetDef i exp0 exp1 -> failure t
|
||||
LetDef i exp -> failure t
|
||||
Case pattern guard exp -> failure t
|
||||
BindVar varorwild exp -> failure t
|
||||
BindNoVar exp -> failure t
|
||||
@@ -177,7 +177,7 @@ transVarOrWild t = case t of
|
||||
|
||||
transLetDef :: LetDef -> Result
|
||||
transLetDef t = case t of
|
||||
LetDef i exp0 exp1 -> failure t
|
||||
LetDef i exp -> failure t
|
||||
|
||||
transCase :: Case -> Result
|
||||
transCase t = case t of
|
||||
|
||||
@@ -83,7 +83,7 @@ VWild. VarOrWild ::= "_" ;
|
||||
|
||||
EAbs. Exp1 ::= "\\" VarOrWild "->" Exp1 ;
|
||||
ELet. Exp1 ::= "let" "{" [LetDef] "}" "in" Exp1 ;
|
||||
LetDef. LetDef ::= Ident ":" Exp "=" Exp ;
|
||||
LetDef. LetDef ::= Ident "=" Exp ;
|
||||
separator LetDef ";" ;
|
||||
ECase. Exp1 ::= "case" Exp "of" "{" [Case] "}" ;
|
||||
Case. Case ::= Pattern Guard "->" Exp ;
|
||||
|
||||
@@ -550,7 +550,7 @@ substs ss = f (Map.fromList ss)
|
||||
f ss t | Map.null ss = t
|
||||
f ss t = case t of
|
||||
ELet ds e3 ->
|
||||
ELet [LetDef id (f ss e1) (f ss' e2) | LetDef id e1 e2 <- ds] (f ss' e3)
|
||||
ELet [LetDef id (f ss' e2) | LetDef id e2 <- ds] (f ss' e3)
|
||||
where ss' = ss `mapMinusSet` letDefBinds ds
|
||||
Case p g e -> Case p (f ss' g) (f ss' e) where ss' = ss `mapMinusSet` binds p
|
||||
EAbs (VVar id) e -> EAbs (VVar id) (f ss' e) where ss' = Map.delete id ss
|
||||
@@ -618,13 +618,10 @@ freshIdents n = replicateM n freshIdent
|
||||
|
||||
-- | Get the variables bound by a set of let definitions.
|
||||
letDefBinds :: [LetDef] -> Set Ident
|
||||
letDefBinds defs = Set.fromList [ id | LetDef id _ _ <- defs]
|
||||
|
||||
letDefTypes :: [LetDef] -> [Exp]
|
||||
letDefTypes defs = [ exp1 | LetDef _ exp1 _ <- defs ]
|
||||
letDefBinds defs = Set.fromList [ id | LetDef id _ <- defs]
|
||||
|
||||
letDefRhss :: [LetDef] -> [Exp]
|
||||
letDefRhss defs = [ exp2 | LetDef _ _ exp2 <- defs ]
|
||||
letDefRhss defs = [ exp | LetDef _ exp <- defs ]
|
||||
|
||||
-- | Get the free variables in an expression.
|
||||
freeVars :: Exp -> Set Ident
|
||||
@@ -632,10 +629,8 @@ freeVars = f
|
||||
where
|
||||
f :: Tree a -> Set Ident
|
||||
f t = case t of
|
||||
ELet defs exp3 ->
|
||||
Set.unions $
|
||||
(Set.unions (f exp3:map f (letDefRhss defs)) Set.\\ letDefBinds defs)
|
||||
:map f (letDefTypes defs)
|
||||
ELet defs exp ->
|
||||
Set.unions (f exp:map f (letDefRhss defs)) Set.\\ letDefBinds defs
|
||||
ECase exp cases -> f exp `Set.union`
|
||||
Set.unions [(f g `Set.union` f e) Set.\\ binds p
|
||||
| Case p g e <- cases]
|
||||
@@ -653,8 +648,7 @@ countFreeOccur x = f
|
||||
where
|
||||
f :: Tree a -> Int
|
||||
f t = case t of
|
||||
ELet defs _ | x `Set.member` letDefBinds defs ->
|
||||
sum (map f (letDefTypes defs))
|
||||
ELet defs _ | x `Set.member` letDefBinds defs -> 0
|
||||
Case p _ _ | x `Set.member` binds p -> 0
|
||||
EAbs (VVar id) _ | id == x -> 0
|
||||
EPi (VVar id) exp1 _ | id == x -> f exp1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
x : Apa
|
||||
x = let x : T = y
|
||||
x = let x = y
|
||||
in case y of
|
||||
f -> q
|
||||
_ -> a
|
||||
|
||||
@@ -85,8 +85,8 @@ int2bin = int2bin_ End
|
||||
|
||||
int2bin_ : Binary_Tree Bin -> Integer -> Binary_Tree Bin
|
||||
int2bin_ b 0 = b
|
||||
int2bin_ b n = let d : Integer = if n % 2 == 0 then Zero else One
|
||||
q : Integer = n / 2
|
||||
int2bin_ b n = let d = if n % 2 == 0 then Zero else One
|
||||
q = n / 2
|
||||
in int2bin_ (d b) q
|
||||
|
||||
num2bin : Tree Numeral -> Binary_Tree Bin
|
||||
|
||||
@@ -13,7 +13,7 @@ isSnake _ x = case x of
|
||||
|
||||
wideSnake : (A : Cat) -> Tree A -> Tree A
|
||||
wideSnake _ x = case x of
|
||||
Wide y -> let y' : CN = wideSnake ? y
|
||||
Wide y -> let y' = wideSnake ? y
|
||||
in if isSnake CN y' then Thick y' else Wide y'
|
||||
_ -> composOp ? ? compos_Tree ? wideSnake x
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ concat A = foldr (List A) (List A) (append A) (Nil A)
|
||||
partition : (A : Type) -> (A -> Bool) -> List A -> Pair (List A) (List A)
|
||||
partition _ _ [] = ([],[])
|
||||
partition A p (x::xs) =
|
||||
let r : Pair (List A) (List A) = partition A p xs
|
||||
let r = partition A p xs
|
||||
in if p x then (x :: r.p1, r.p2) else (r.p1, x :: r.p2)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user