From c243947024e67febcc3574a2bbc898375d8c4a12 Mon Sep 17 00:00:00 2001 From: "Benedict R. Gaster" <benedict.gaster@uwe.ac.uk> Date: Tue, 21 Aug 2018 22:02:02 +0100 Subject: [PATCH] Fixed issues with ghc 8.4. --- .gitignore | 0 README.md | 0 examples/compl.smac | 0 examples/cond.smac | 0 examples/div.smac | 0 examples/dumpstack.smac | 0 examples/ex1.smac | 0 examples/ex2.smac | 0 examples/ex3.smac | 0 examples/ex4.smac | 0 examples/ex5.smac | 0 examples/ex6.smac | 0 examples/fib.smac | 0 examples/fib_iterative.smac | 0 examples/flush.smac | 0 examples/lab.smac | 0 examples/leq.smac | 0 examples/mul.smac | 0 examples/neq.smac | 0 examples/not.smac | 0 examples/subcall-return.smac | 0 examples/subroutine_add.smac | 0 smachine.cabal | 0 src/CmdMain.hs | 0 src/Eval.hs | 0 src/EvalNonMonad.hs | 0 src/Foo.hs | 0 src/Main.hs | 0 src/PPrint.hs | 32 ++++++++++++++++---------------- src/Parser.hs | 0 src/Types.hs | 4 ++-- 31 files changed, 18 insertions(+), 18 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 README.md mode change 100644 => 100755 examples/compl.smac mode change 100644 => 100755 examples/cond.smac mode change 100644 => 100755 examples/div.smac mode change 100644 => 100755 examples/dumpstack.smac mode change 100644 => 100755 examples/ex1.smac mode change 100644 => 100755 examples/ex2.smac mode change 100644 => 100755 examples/ex3.smac mode change 100644 => 100755 examples/ex4.smac mode change 100644 => 100755 examples/ex5.smac mode change 100644 => 100755 examples/ex6.smac mode change 100644 => 100755 examples/fib.smac mode change 100644 => 100755 examples/fib_iterative.smac mode change 100644 => 100755 examples/flush.smac mode change 100644 => 100755 examples/lab.smac mode change 100644 => 100755 examples/leq.smac mode change 100644 => 100755 examples/mul.smac mode change 100644 => 100755 examples/neq.smac mode change 100644 => 100755 examples/not.smac mode change 100644 => 100755 examples/subcall-return.smac mode change 100644 => 100755 examples/subroutine_add.smac mode change 100644 => 100755 smachine.cabal mode change 100644 => 100755 src/CmdMain.hs mode change 100644 => 100755 src/Eval.hs mode change 100644 => 100755 src/EvalNonMonad.hs mode change 100644 => 100755 src/Foo.hs mode change 100644 => 100755 src/Main.hs mode change 100644 => 100755 src/Parser.hs mode change 100644 => 100755 src/Types.hs diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/examples/compl.smac b/examples/compl.smac old mode 100644 new mode 100755 diff --git a/examples/cond.smac b/examples/cond.smac old mode 100644 new mode 100755 diff --git a/examples/div.smac b/examples/div.smac old mode 100644 new mode 100755 diff --git a/examples/dumpstack.smac b/examples/dumpstack.smac old mode 100644 new mode 100755 diff --git a/examples/ex1.smac b/examples/ex1.smac old mode 100644 new mode 100755 diff --git a/examples/ex2.smac b/examples/ex2.smac old mode 100644 new mode 100755 diff --git a/examples/ex3.smac b/examples/ex3.smac old mode 100644 new mode 100755 diff --git a/examples/ex4.smac b/examples/ex4.smac old mode 100644 new mode 100755 diff --git a/examples/ex5.smac b/examples/ex5.smac old mode 100644 new mode 100755 diff --git a/examples/ex6.smac b/examples/ex6.smac old mode 100644 new mode 100755 diff --git a/examples/fib.smac b/examples/fib.smac old mode 100644 new mode 100755 diff --git a/examples/fib_iterative.smac b/examples/fib_iterative.smac old mode 100644 new mode 100755 diff --git a/examples/flush.smac b/examples/flush.smac old mode 100644 new mode 100755 diff --git a/examples/lab.smac b/examples/lab.smac old mode 100644 new mode 100755 diff --git a/examples/leq.smac b/examples/leq.smac old mode 100644 new mode 100755 diff --git a/examples/mul.smac b/examples/mul.smac old mode 100644 new mode 100755 diff --git a/examples/neq.smac b/examples/neq.smac old mode 100644 new mode 100755 diff --git a/examples/not.smac b/examples/not.smac old mode 100644 new mode 100755 diff --git a/examples/subcall-return.smac b/examples/subcall-return.smac old mode 100644 new mode 100755 diff --git a/examples/subroutine_add.smac b/examples/subroutine_add.smac old mode 100644 new mode 100755 diff --git a/smachine.cabal b/smachine.cabal old mode 100644 new mode 100755 diff --git a/src/CmdMain.hs b/src/CmdMain.hs old mode 100644 new mode 100755 diff --git a/src/Eval.hs b/src/Eval.hs old mode 100644 new mode 100755 diff --git a/src/EvalNonMonad.hs b/src/EvalNonMonad.hs old mode 100644 new mode 100755 diff --git a/src/Foo.hs b/src/Foo.hs old mode 100644 new mode 100755 diff --git a/src/Main.hs b/src/Main.hs old mode 100644 new mode 100755 diff --git a/src/PPrint.hs b/src/PPrint.hs index d94b995..c0b63d1 100755 --- a/src/PPrint.hs +++ b/src/PPrint.hs @@ -23,7 +23,7 @@ module PPrint , show, putDoc, hPutDoc - , (<>) + , (PPrint.<>) , (<+>) , (</>), (<//>) , (PPrint.<$>), (<$$>) @@ -77,9 +77,9 @@ semiBraces = encloseSep lbrace rbrace semi encloseSep left right sep ds = case ds of - [] -> left <> right - [d] -> left <> d <> right - _ -> align (cat (zipWith (<>) (left : repeat sep) ds) <> right) + [] -> left PPrint.<> right + [d] -> left PPrint.<> d PPrint.<> right + _ -> align (cat (zipWith (PPrint.<>) (left : repeat sep) ds) PPrint.<> right) ----------------------------------------------------------- @@ -87,7 +87,7 @@ encloseSep left right sep ds ----------------------------------------------------------- punctuate p [] = [] punctuate p [d] = [d] -punctuate p (d:ds) = (d <> p) : punctuate p ds +punctuate p (d:ds) = (d PPrint.<> p) : punctuate p ds ----------------------------------------------------------- @@ -100,18 +100,18 @@ vsep = fold (PPrint.<$>) cat = group . vcat fillCat = fold (<//>) -hcat = fold (<>) +hcat = fold (PPrint.<>) vcat = fold (<$$>) fold f [] = empty fold f ds = foldr1 f ds x <> y = x `beside` y -x <+> y = x <> space <> y -x </> y = x <> softline <> y -x <//> y = x <> softbreak <> y -x <$> y = x <> line <> y -x <$$> y = x <> linebreak <> y +x <+> y = x PPrint.<> space PPrint.<> y +x </> y = x PPrint.<> softline PPrint.<> y +x <//> y = x PPrint.<> softbreak PPrint.<> y +x <$> y = x PPrint.<> line PPrint.<> y +x <$$> y = x PPrint.<> linebreak PPrint.<> y softline = group line softbreak = group linebreak @@ -122,7 +122,7 @@ braces = enclose lbrace rbrace parens = enclose lparen rparen angles = enclose langle rangle brackets = enclose lbracket rbracket -enclose l r x = l <> x <> r +enclose l r x = l PPrint.<> x PPrint.<> r lparen = char '(' rparen = char ')' @@ -150,9 +150,9 @@ equals = char '=' -- string is like "text" but replaces '\n' by "line" string "" = empty -string ('\n':s) = line <> string s +string ('\n':s) = line PPrint.<> string s string s = case (span (/='\n') s) of - (xs,ys) -> text xs <> string ys + (xs,ys) -> text xs PPrint.<> string ys bool :: Bool -> Doc bool b = text (show b) @@ -240,13 +240,13 @@ fill f d = width d (\w -> if (w >= f) then empty else text (spaces (f - w))) -width d f = column (\k1 -> d <> column (\k2 -> f (k2 - k1))) +width d f = column (\k1 -> d PPrint.<> column (\k2 -> f (k2 - k1))) ----------------------------------------------------------- -- semi primitive: Alignment and indentation ----------------------------------------------------------- -indent i d = hang i (text (spaces i) <> d) +indent i d = hang i (text (spaces i) PPrint.<> d) hang i d = align (nest i d) diff --git a/src/Parser.hs b/src/Parser.hs old mode 100644 new mode 100755 diff --git a/src/Types.hs b/src/Types.hs old mode 100644 new mode 100755 index 9f4984b..b8b8a67 --- a/src/Types.hs +++ b/src/Types.hs @@ -215,7 +215,7 @@ ppCommand Out = ppHelper "OUT" ppCommand OutLN = ppHelper "OUTLN" ppCommand In = ppHelper "IN" ppCommand Flush = ppHelper "FLUSH" -ppCommand (Label n _) = text n <> text ":" +ppCommand (Label n _) = text n PPrint.<> text ":" ppCommand Store = ppHelper "STORE" ppCommand StoreIdx = ppHelper "STOREIDX" ppCommand Load = ppHelper "LOAD" @@ -238,7 +238,7 @@ ppCommand Not = ppHelper "Not" ppCommand JmpNZ = ppHelper "JMPNZ" ppCommand Jmp = ppHelper "JMP" ppCommand Subcall = ppHelper "SUBCALL" -ppCommand (AddrOf n) = indent 1 $ text "&" <> text n +ppCommand (AddrOf n) = indent 1 $ text "&" PPrint.<> text n ppHelper = indent 1 . text -- GitLab