From 5b2b5621f83723e22beb4b6cbbf5963ee34d548b Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 2 Nov 2007 16:00:54 +0000 Subject: [PATCH] Add module of special magic GHC desugaring helper functions Currently containing only one such helper: (>>>) for arrow desugaring --- GHC/Desugar.hs | 30 ++++++++++++++++++++++++++++++ base.cabal | 1 + 2 files changed, 31 insertions(+) create mode 100644 GHC/Desugar.hs diff --git a/GHC/Desugar.hs b/GHC/Desugar.hs new file mode 100644 index 0000000..67ff663 --- /dev/null +++ b/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 diff --git a/base.cabal b/base.cabal index 376c15b..cf14de2 100644 --- a/base.cabal +++ b/base.cabal @@ -34,6 +34,7 @@ Library { GHC.Base, GHC.Conc, GHC.ConsoleHandler, + GHC.Desugar, GHC.Dotnet, GHC.Enum, GHC.Environment, -- 1.7.10.4