summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Desugar.hs
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-11-02 16:00:54 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-11-02 16:00:54 +0000
commit27fa0a48fd6c52f696a7337e69dc17e341ddd951 (patch)
tree5f0047bd3a290b78c2231c49589fc95ab9362e85 /libraries/base/GHC/Desugar.hs
parent6270bf07f42dd483d6e6bceb01261da7bbe23251 (diff)
downloadhaskell-27fa0a48fd6c52f696a7337e69dc17e341ddd951.tar.gz
Add module of special magic GHC desugaring helper functions
Currently containing only one such helper: (>>>) for arrow desugaring
Diffstat (limited to 'libraries/base/GHC/Desugar.hs')
-rw-r--r--libraries/base/GHC/Desugar.hs30
1 files changed, 30 insertions, 0 deletions
diff --git a/libraries/base/GHC/Desugar.hs b/libraries/base/GHC/Desugar.hs
new file mode 100644
index 0000000000..67ff6638f4
--- /dev/null
+++ b/libraries/base/GHC/Desugar.hs
@@ -0,0 +1,30 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : GHC.Desugar
+-- Copyright : (c) The University of Glasgow, 2007
+-- License : see libraries/base/LICENSE
+--
+-- Maintainer : cvs-ghc@haskell.org
+-- Stability : internal
+-- Portability : non-portable (GHC extensions)
+--
+-- Support code for desugaring in GHC
+--
+-----------------------------------------------------------------------------
+
+-- #hide
+module GHC.Desugar ((>>>)) where
+
+import Control.Arrow (Arrow(..))
+import Control.Category ((.))
+import Prelude hiding ((.))
+
+-- A version of Control.Category.>>> overloaded on Arrow
+#ifndef __HADDOCK__
+(>>>) :: forall arr. Arrow arr => forall a b c. arr a b -> arr b c -> arr a c
+#endif
+-- NB: the type of this function is the "shape" that GHC expects
+-- in tcInstClassOp. So don't put all the foralls at the front!
+-- Yes, this is a bit grotesque, but heck it works and the whole
+-- arrows stuff needs reworking anyway!
+f >>> g = g . f