From 7775aa0c637b6d9924aad08195ed5772b2d87e5b Mon Sep 17 00:00:00 2001 From: David Feuer Date: Tue, 3 Jul 2018 17:37:32 -0400 Subject: [PATCH] Remove orphan instances For some reason, the `Direct` module has been exporting orphan `Show` instances for standard types, which is pretty awful. Let's just not. --- monad-par/Control/Monad/Par/Scheds/ContFree.hs | 12 ++++++------ monad-par/Control/Monad/Par/Scheds/DirectInternal.hs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/monad-par/Control/Monad/Par/Scheds/ContFree.hs b/monad-par/Control/Monad/Par/Scheds/ContFree.hs index a205c57b..e787f2d3 100644 --- a/monad-par/Control/Monad/Par/Scheds/ContFree.hs +++ b/monad-par/Control/Monad/Par/Scheds/ContFree.hs @@ -163,8 +163,8 @@ modifyHotVar = atomicModifyIORef modifyHotVar_ v fn = atomicModifyIORef v (\a -> (fn a, ())) readHotVar = readIORef writeHotVar = writeIORef -instance Show (IORef a) where - show ref = "" +--instance Show (IORef a) where +-- show ref = "" -- hotVarTransaction = id hotVarTransaction = error "Transactions not currently possible for IO refs" @@ -181,8 +181,8 @@ modifyHotVar v fn = modifyMVar v (return . fn) modifyHotVar_ v fn = modifyMVar_ v (return . fn) readHotVar = readMVar writeHotVar v x = do swapMVar v x; return () -instance Show (MVar a) where - show ref = "" +--instance Show (MVar a) where +-- show ref = "" -- hotVarTransaction = id -- We could in theory do this by taking the mvar to grab the lock. @@ -204,8 +204,8 @@ modifyHotVar tv fn = atomically (do x <- readTVar tv modifyHotVar_ tv fn = atomically (do x <- readTVar tv; writeTVar tv (fn x)) readHotVar x = atomically $ readTVar x writeHotVar v x = atomically $ writeTVar v x -instance Show (TVar a) where - show ref = "" +--instance Show (TVar a) where +-- show ref = "" hotVarTransaction = atomically readHotVarRaw = readTVar diff --git a/monad-par/Control/Monad/Par/Scheds/DirectInternal.hs b/monad-par/Control/Monad/Par/Scheds/DirectInternal.hs index 10862043..5172784f 100644 --- a/monad-par/Control/Monad/Par/Scheds/DirectInternal.hs +++ b/monad-par/Control/Monad/Par/Scheds/DirectInternal.hs @@ -108,8 +108,8 @@ modifyHotVar = atomicModifyIORef modifyHotVar_ v fn = atomicModifyIORef v (\a -> (fn a, ())) readHotVar = readIORef writeHotVar = writeIORef -instance Show (IORef a) where - show _ref = "" +--instance Show (IORef a) where +-- show _ref = "" writeHotVarRaw :: HotVar a -> a -> IO () -- hotVarTransaction = id @@ -128,8 +128,8 @@ modifyHotVar v fn = modifyMVar v (return . fn) modifyHotVar_ v fn = modifyMVar_ v (return . fn) readHotVar = readMVar writeHotVar v x = do swapMVar v x; return () -instance Show (MVar a) where - show _ref = "" +--instance Show (MVar a) where +-- show _ref = "" -- hotVarTransaction = id -- We could in theory do this by taking the mvar to grab the lock. @@ -151,8 +151,8 @@ modifyHotVar tv fn = atomically (do x <- readTVar tv modifyHotVar_ tv fn = atomically (do x <- readTVar tv; writeTVar tv (fn x)) readHotVar x = atomically $ readTVar x writeHotVar v x = atomically $ writeTVar v x -instance Show (TVar a) where - show ref = "" +--instance Show (TVar a) where +-- show ref = "" hotVarTransaction = atomically readHotVarRaw = readTVar