From 5caacc93b6904c13dd363f3ba4815c25c6c4fb26 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Mon, 21 Mar 2011 23:43:46 +0000 Subject: [PATCH] Rename System.Event to GHC.Event It's just an internal GHC library, for now at least --- GHC/Conc/IO.hs | 2 +- {System => GHC}/Event.hs | 4 ++-- {System => GHC}/Event/Array.hs | 4 ++-- {System => GHC}/Event/Clock.hsc | 2 +- {System => GHC}/Event/Control.hs | 2 +- {System => GHC}/Event/EPoll.hsc | 8 ++++---- {System => GHC}/Event/IntMap.hs | 4 ++-- {System => GHC}/Event/Internal.hs | 2 +- {System => GHC}/Event/KQueue.hsc | 8 ++++---- {System => GHC}/Event/Manager.hs | 26 +++++++++++++------------- {System => GHC}/Event/PSQ.hs | 6 +++--- {System => GHC}/Event/Poll.hsc | 6 +++--- {System => GHC}/Event/Thread.hs | 8 ++++---- {System => GHC}/Event/Unique.hs | 2 +- base.cabal | 26 +++++++++++++------------- 15 files changed, 55 insertions(+), 55 deletions(-) rename {System => GHC}/Event.hs (93%) rename {System => GHC}/Event/Array.hs (98%) rename {System => GHC}/Event/Clock.hsc (96%) rename {System => GHC}/Event/Control.hs (99%) rename {System => GHC}/Event/EPoll.hsc (97%) rename {System => GHC}/Event/IntMap.hs (99%) rename {System => GHC}/Event/Internal.hs (99%) rename {System => GHC}/Event/KQueue.hsc (98%) rename {System => GHC}/Event/Manager.hs (95%) rename {System => GHC}/Event/PSQ.hs (99%) rename {System => GHC}/Event/Poll.hsc (97%) rename {System => GHC}/Event/Thread.hs (96%) rename {System => GHC}/Event/Unique.hs (97%) diff --git a/GHC/Conc/IO.hs b/GHC/Conc/IO.hs index fc80026..83a8a1c 100644 --- a/GHC/Conc/IO.hs +++ b/GHC/Conc/IO.hs @@ -65,7 +65,7 @@ import GHC.Conc.Windows (asyncRead, asyncWrite, asyncDoProc, asyncReadBA, asyncWriteBA, ConsoleEvent(..), win32ConsoleHandler, toWin32ConsoleEvent) #else -import qualified System.Event.Thread as Event +import qualified GHC.Event.Thread as Event #endif ensureIOManagerIsRunning :: IO () diff --git a/System/Event.hs b/GHC/Event.hs similarity index 93% rename from System/Event.hs rename to GHC/Event.hs index 9fd836d..6bb975e 100644 --- a/System/Event.hs +++ b/GHC/Event.hs @@ -2,7 +2,7 @@ -- descriptors and timeouts. -- -- This module should be considered GHC internal. -module System.Event +module GHC.Event ( -- * Types EventManager @@ -36,4 +36,4 @@ module System.Event , unregisterTimeout ) where -import System.Event.Manager +import GHC.Event.Manager diff --git a/System/Event/Array.hs b/GHC/Event/Array.hs similarity index 98% rename from System/Event/Array.hs rename to GHC/Event/Array.hs index ff4b32c..464bbf4 100644 --- a/System/Event/Array.hs +++ b/GHC/Event/Array.hs @@ -1,6 +1,6 @@ {-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, NoImplicitPrelude #-} -module System.Event.Array +module GHC.Event.Array ( Array , capacity @@ -46,7 +46,7 @@ import GHC.Show (show) -- This fugly hack is brought by GHC's apparent reluctance to deal -- with MagicHash and UnboxedTuples when inferring types. Eek! #define CHECK_BOUNDS(_func_,_len_,_k_) \ -if (_k_) < 0 || (_k_) >= (_len_) then error ("System.Event.Array." ++ (_func_) ++ ": bounds error, index " ++ show (_k_) ++ ", capacity " ++ show (_len_)) else +if (_k_) < 0 || (_k_) >= (_len_) then error ("GHC.Event.Array." ++ (_func_) ++ ": bounds error, index " ++ show (_k_) ++ ", capacity " ++ show (_len_)) else #else #define CHECK_BOUNDS(_func_,_len_,_k_) #endif diff --git a/System/Event/Clock.hsc b/GHC/Event/Clock.hsc similarity index 96% rename from System/Event/Clock.hsc rename to GHC/Event/Clock.hsc index ae31a7b..98758a3 100644 --- a/System/Event/Clock.hsc +++ b/GHC/Event/Clock.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE NoImplicitPrelude, BangPatterns, ForeignFunctionInterface #-} -module System.Event.Clock (getCurrentTime) where +module GHC.Event.Clock (getCurrentTime) where #include diff --git a/System/Event/Control.hs b/GHC/Event/Control.hs similarity index 99% rename from System/Event/Control.hs rename to GHC/Event/Control.hs index 635d864..bd58ae2 100644 --- a/System/Event/Control.hs +++ b/GHC/Event/Control.hs @@ -5,7 +5,7 @@ , BangPatterns #-} -module System.Event.Control +module GHC.Event.Control ( -- * Managing the IO manager Signal diff --git a/System/Event/EPoll.hsc b/GHC/Event/EPoll.hsc similarity index 97% rename from System/Event/EPoll.hsc rename to GHC/Event/EPoll.hsc index f30c4bd..1cfd202 100644 --- a/System/Event/EPoll.hsc +++ b/GHC/Event/EPoll.hsc @@ -14,13 +14,13 @@ -- -- epoll decouples monitor an fd from the process of registering it. -- -module System.Event.EPoll +module GHC.Event.EPoll ( new , available ) where -import qualified System.Event.Internal as E +import qualified GHC.Event.Internal as E #include "EventConfig.h" #if !defined(HAVE_EPOLL) @@ -54,8 +54,8 @@ import System.Posix.Internals (c_close) import System.Posix.Internals (setCloseOnExec) import System.Posix.Types (Fd(..)) -import qualified System.Event.Array as A -import System.Event.Internal (Timeout(..)) +import qualified GHC.Event.Array as A +import GHC.Event.Internal (Timeout(..)) available :: Bool available = True diff --git a/System/Event/IntMap.hs b/GHC/Event/IntMap.hs similarity index 99% rename from System/Event/IntMap.hs rename to GHC/Event/IntMap.hs index 61ae002..e324026 100644 --- a/System/Event/IntMap.hs +++ b/GHC/Event/IntMap.hs @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | --- Module : System.Event.IntMap +-- Module : GHC.Event.IntMap -- Copyright : (c) Daan Leijen 2002 -- (c) Andriy Palamarchuk 2008 -- License : BSD-style @@ -40,7 +40,7 @@ -- (32 or 64). ----------------------------------------------------------------------------- -module System.Event.IntMap +module GHC.Event.IntMap ( -- * Map type IntMap diff --git a/System/Event/Internal.hs b/GHC/Event/Internal.hs similarity index 99% rename from System/Event/Internal.hs rename to GHC/Event/Internal.hs index 545ff6f..b5d7c0f 100644 --- a/System/Event/Internal.hs +++ b/GHC/Event/Internal.hs @@ -1,6 +1,6 @@ {-# LANGUAGE ExistentialQuantification, NoImplicitPrelude #-} -module System.Event.Internal +module GHC.Event.Internal ( -- * Event back end Backend diff --git a/System/Event/KQueue.hsc b/GHC/Event/KQueue.hsc similarity index 98% rename from System/Event/KQueue.hsc rename to GHC/Event/KQueue.hsc index 4a86435..19c7adf 100644 --- a/System/Event/KQueue.hsc +++ b/GHC/Event/KQueue.hsc @@ -6,13 +6,13 @@ , BangPatterns #-} -module System.Event.KQueue +module GHC.Event.KQueue ( new , available ) where -import qualified System.Event.Internal as E +import qualified GHC.Event.Internal as E #include "EventConfig.h" #if !defined(HAVE_KQUEUE) @@ -41,10 +41,10 @@ import GHC.Err (undefined) import GHC.Num (Num(..)) import GHC.Real (ceiling, floor, fromIntegral) import GHC.Show (Show(show)) -import System.Event.Internal (Timeout(..)) +import GHC.Event.Internal (Timeout(..)) import System.Posix.Internals (c_close) import System.Posix.Types (Fd(..)) -import qualified System.Event.Array as A +import qualified GHC.Event.Array as A #if defined(HAVE_KEVENT64) import Data.Int (Int64) diff --git a/System/Event/Manager.hs b/GHC/Event/Manager.hs similarity index 95% rename from System/Event/Manager.hs rename to GHC/Event/Manager.hs index 9766774..bb7379c 100644 --- a/System/Event/Manager.hs +++ b/GHC/Event/Manager.hs @@ -7,7 +7,7 @@ , FlexibleInstances #-} -module System.Event.Manager +module GHC.Event.Manager ( -- * Types EventManager @@ -62,23 +62,23 @@ import GHC.List (filter) import GHC.Num (Num(..)) import GHC.Real ((/), fromIntegral ) import GHC.Show (Show(..)) -import System.Event.Clock (getCurrentTime) -import System.Event.Control -import System.Event.Internal (Backend, Event, evtClose, evtRead, evtWrite, - Timeout(..)) -import System.Event.Unique (Unique, UniqueSource, newSource, newUnique) +import GHC.Event.Clock (getCurrentTime) +import GHC.Event.Control +import GHC.Event.Internal (Backend, Event, evtClose, evtRead, evtWrite, + Timeout(..)) +import GHC.Event.Unique (Unique, UniqueSource, newSource, newUnique) import System.Posix.Types (Fd) -import qualified System.Event.IntMap as IM -import qualified System.Event.Internal as I -import qualified System.Event.PSQ as Q +import qualified GHC.Event.IntMap as IM +import qualified GHC.Event.Internal as I +import qualified GHC.Event.PSQ as Q #if defined(HAVE_KQUEUE) -import qualified System.Event.KQueue as KQueue +import qualified GHC.Event.KQueue as KQueue #elif defined(HAVE_EPOLL) -import qualified System.Event.EPoll as EPoll +import qualified GHC.Event.EPoll as EPoll #elif defined(HAVE_POLL) -import qualified System.Event.Poll as Poll +import qualified GHC.Event.Poll as Poll #else # error not implemented for this operating system #endif @@ -240,7 +240,7 @@ loop mgr@EventManager{..} = do Created -> go Q.empty `finally` cleanup mgr Dying -> cleanup mgr _ -> do cleanup mgr - error $ "System.Event.Manager.loop: state is already " ++ + error $ "GHC.Event.Manager.loop: state is already " ++ show state where go q = do (running, q') <- step mgr q diff --git a/System/Event/PSQ.hs b/GHC/Event/PSQ.hs similarity index 99% rename from System/Event/PSQ.hs rename to GHC/Event/PSQ.hs index f86be5b..8c285bf 100644 --- a/System/Event/PSQ.hs +++ b/GHC/Event/PSQ.hs @@ -48,7 +48,7 @@ -- Queues/, ICFP 2001, pp. 110-121 -- -- -module System.Event.PSQ +module GHC.Event.PSQ ( -- * Binding Type Elem(..) @@ -91,7 +91,7 @@ import Data.Maybe (Maybe(..)) import GHC.Base import GHC.Num (Num(..)) import GHC.Show (Show(showsPrec)) -import System.Event.Unique (Unique) +import GHC.Event.Unique (Unique) -- | @E k p@ binds the key @k@ with the priority @p@. data Elem a = E @@ -458,7 +458,7 @@ tourView (Winner e (LLoser _ e' tl m tr) m') = -- Utility functions moduleError :: String -> String -> a -moduleError fun msg = error ("System.Event.PSQ." ++ fun ++ ':' : ' ' : msg) +moduleError fun msg = error ("GHC.Event.PSQ." ++ fun ++ ':' : ' ' : msg) {-# NOINLINE moduleError #-} ------------------------------------------------------------------------ diff --git a/System/Event/Poll.hsc b/GHC/Event/Poll.hsc similarity index 97% rename from System/Event/Poll.hsc rename to GHC/Event/Poll.hsc index 323ab9c..82acc62 100644 --- a/System/Event/Poll.hsc +++ b/GHC/Event/Poll.hsc @@ -5,7 +5,7 @@ , BangPatterns #-} -module System.Event.Poll +module GHC.Event.Poll ( new , available @@ -41,8 +41,8 @@ import GHC.Real (ceiling, fromIntegral) import GHC.Show (Show) import System.Posix.Types (Fd(..)) -import qualified System.Event.Array as A -import qualified System.Event.Internal as E +import qualified GHC.Event.Array as A +import qualified GHC.Event.Internal as E available :: Bool available = True diff --git a/System/Event/Thread.hs b/GHC/Event/Thread.hs similarity index 96% rename from System/Event/Thread.hs rename to GHC/Event/Thread.hs index 9c58a5a..dbfb14f 100644 --- a/System/Event/Thread.hs +++ b/GHC/Event/Thread.hs @@ -1,6 +1,6 @@ {-# LANGUAGE BangPatterns, ForeignFunctionInterface, NoImplicitPrelude #-} -module System.Event.Thread +module GHC.Event.Thread ( ensureIOManagerIsRunning , threadWaitRead @@ -21,10 +21,10 @@ import GHC.Conc.Sync (TVar, ThreadId, ThreadStatus(..), atomically, forkIO, import GHC.IO (mask_, onException) import GHC.IO.Exception (ioError) import GHC.MVar (MVar, newEmptyMVar, newMVar, putMVar, takeMVar) -import System.Event.Internal (eventIs, evtClose) -import System.Event.Manager (Event, EventManager, evtRead, evtWrite, loop, +import GHC.Event.Internal (eventIs, evtClose) +import GHC.Event.Manager (Event, EventManager, evtRead, evtWrite, loop, new, registerFd, unregisterFd_, registerTimeout) -import qualified System.Event.Manager as M +import qualified GHC.Event.Manager as M import System.IO.Unsafe (unsafePerformIO) import System.Posix.Types (Fd) diff --git a/System/Event/Unique.hs b/GHC/Event/Unique.hs similarity index 97% rename from System/Event/Unique.hs rename to GHC/Event/Unique.hs index 879232c..66b799c 100644 --- a/System/Event/Unique.hs +++ b/GHC/Event/Unique.hs @@ -1,5 +1,5 @@ {-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving, NoImplicitPrelude #-} -module System.Event.Unique +module GHC.Event.Unique ( UniqueSource , Unique(..) diff --git a/base.cabal b/base.cabal index d863d7a..6700537 100644 --- a/base.cabal +++ b/base.cabal @@ -207,20 +207,20 @@ Library { } if !os(windows) { exposed-modules: - System.Event + GHC.Event other-modules: - System.Event.Array - System.Event.Clock - System.Event.Control - System.Event.EPoll - System.Event.IntMap - System.Event.Internal - System.Event.KQueue - System.Event.Manager - System.Event.PSQ - System.Event.Poll - System.Event.Thread - System.Event.Unique + GHC.Event.Array + GHC.Event.Clock + GHC.Event.Control + GHC.Event.EPoll + GHC.Event.IntMap + GHC.Event.Internal + GHC.Event.KQueue + GHC.Event.Manager + GHC.Event.PSQ + GHC.Event.Poll + GHC.Event.Thread + GHC.Event.Unique } -- We need to set the package name to base (without a version number) -- as it's magic. -- 1.7.10.4