[commit: ghc] master: Add Output instance for OrdList (93b1a43)
git at git.haskell.org
git at git.haskell.org
Thu Aug 7 08:55:37 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/93b1a43ebe8bf145b35e903966d4a62b7847f213/ghc
>---------------------------------------------------------------
commit 93b1a43ebe8bf145b35e903966d4a62b7847f213
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Aug 1 16:40:18 2014 +0100
Add Output instance for OrdList
>---------------------------------------------------------------
93b1a43ebe8bf145b35e903966d4a62b7847f213
compiler/utils/OrdList.lhs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/compiler/utils/OrdList.lhs b/compiler/utils/OrdList.lhs
index d1d8708..42abb51 100644
--- a/compiler/utils/OrdList.lhs
+++ b/compiler/utils/OrdList.lhs
@@ -15,6 +15,8 @@ module OrdList (
mapOL, fromOL, toOL, foldrOL, foldlOL
) where
+import Outputable
+
infixl 5 `appOL`
infixl 5 `snocOL`
infixr 5 `consOL`
@@ -28,6 +30,8 @@ data OrdList a
| Two (OrdList a) -- Invariant: non-empty
(OrdList a) -- Invariant: non-empty
+instance Outputable a => Outputable (OrdList a) where
+ ppr ol = ppr (fromOL ol) -- Convert to list and print that
nilOL :: OrdList a
isNilOL :: OrdList a -> Bool
More information about the ghc-commits
mailing list