diff options
| author | aarne <aarne@chalmers.se> | 2009-12-09 09:47:16 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2009-12-09 09:47:16 +0000 |
| commit | c8ceed08efcc0bdc1fcbd89bce643d9f52f0991b (patch) | |
| tree | 5f0b314341c129eba1bc67b8b887fb8a4486fad8 /old-lib/prelude/Formal.gf | |
| parent | 101df06f6c8380328d4266adadac3ab6d1bac0b3 (diff) | |
moving a few things to deprecated
Diffstat (limited to 'old-lib/prelude/Formal.gf')
| -rw-r--r-- | old-lib/prelude/Formal.gf | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/old-lib/prelude/Formal.gf b/old-lib/prelude/Formal.gf deleted file mode 100644 index 2aa33d9ef..000000000 --- a/old-lib/prelude/Formal.gf +++ /dev/null @@ -1,54 +0,0 @@ -resource Formal = open Prelude in { - --- to replace the old library Precedence - - oper - Prec : PType ; - TermPrec : Type = {s : Str ; p : Prec} ; - - mkPrec : Prec -> Str -> TermPrec = \p,s -> - {s = s ; p = p} ; - - top : TermPrec -> Str = usePrec 0 ; - - constant : Str -> TermPrec = mkPrec highest ; - - infixl : Prec -> Str -> (_,_ : TermPrec) -> TermPrec = \p,f,x,y -> - mkPrec p (usePrec p x ++ f ++ usePrec (nextPrec p) y) ; - infixr : Prec -> Str -> (_,_ : TermPrec) -> TermPrec = \p,f,x,y -> - mkPrec p (usePrec (nextPrec p) x ++ f ++ usePrec p y) ; - infixn : Prec -> Str -> (_,_ : TermPrec) -> TermPrec = \p,f,x,y -> - mkPrec p (usePrec (nextPrec p) x ++ f ++ usePrec (nextPrec p) y) ; - --- auxiliaries, should not be needed so much - - usePrec : Prec -> TermPrec -> Str = \p,x -> - case lessPrec x.p p of { - True => parenth x.s ; - False => parenthOpt x.s - } ; - - parenth : Str -> Str = \s -> "(" ++ s ++ ")" ; - parenthOpt : Str -> Str = \s -> variants {s ; "(" ++ s ++ ")"} ; - ---. --- low-level things: don't use - - Prec : PType = Predef.Ints 4 ; - - highest = 4 ; - - lessPrec : Prec -> Prec -> Bool = \p,q -> - case <<p,q> : Prec * Prec> of { - <3,4> | <2,3> | <2,4> => True ; - <1,1> | <1,0> | <0,0> => False ; - <1,_> | <0,_> => True ; - _ => False - } ; - - nextPrec : Prec -> Prec = \p -> case <p : Prec> of { - 4 => 4 ; - n => Predef.plus n 1 - } ; - -} |
