summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-07-08 21:09:33 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-07-10 19:41:07 +0200
commit9b1ebba2af060fef90dcd722313d3f8041ec5a97 (patch)
treecea0c5bf5971230ac13ebc0cb5777f03bb9de118 /libraries
parent2d06a9f19d5b3ab8c3ff0b24f508c15bedae99d2 (diff)
downloadhaskell-9b1ebba2af060fef90dcd722313d3f8041ec5a97.tar.gz
Delete the WayPar way
Also remove 't' and 's' from ALL_WAYS; they don't exist. Differential Revision: https://phabricator.haskell.org/D1055
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/Data/IORef.hs9
-rw-r--r--libraries/base/System/Mem/StableName.hs18
-rw-r--r--libraries/base/tests/Memo1.lhs6
-rw-r--r--libraries/base/tests/Memo2.lhs6
4 files changed, 1 insertions, 38 deletions
diff --git a/libraries/base/Data/IORef.hs b/libraries/base/Data/IORef.hs
index ff6a8e62d6..c2bc1f7318 100644
--- a/libraries/base/Data/IORef.hs
+++ b/libraries/base/Data/IORef.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE Trustworthy #-}
-{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-}
+{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-}
-----------------------------------------------------------------------------
-- |
@@ -27,10 +27,7 @@ module Data.IORef
atomicModifyIORef,
atomicModifyIORef',
atomicWriteIORef,
-
-#if !defined(__PARALLEL_HASKELL__)
mkWeakIORef,
-#endif
-- ** Memory Model
-- $memmodel
@@ -41,17 +38,13 @@ import GHC.Base
import GHC.STRef
import GHC.IORef hiding (atomicModifyIORef)
import qualified GHC.IORef
-#if !defined(__PARALLEL_HASKELL__)
import GHC.Weak
-#endif
-#if !defined(__PARALLEL_HASKELL__)
-- |Make a 'Weak' pointer to an 'IORef', using the second argument as a finalizer
-- to run when 'IORef' is garbage-collected
mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))
mkWeakIORef r@(IORef (STRef r#)) f = IO $ \s ->
case mkWeak# r# r f s of (# s1, w #) -> (# s1, Weak w #)
-#endif
-- |Mutate the contents of an 'IORef'.
--
diff --git a/libraries/base/System/Mem/StableName.hs b/libraries/base/System/Mem/StableName.hs
index 6967017780..cb4b71b11b 100644
--- a/libraries/base/System/Mem/StableName.hs
+++ b/libraries/base/System/Mem/StableName.hs
@@ -1,10 +1,7 @@
{-# LANGUAGE Trustworthy #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE MagicHash #-}
-#if !defined(__PARALLEL_HASKELL__)
{-# LANGUAGE UnboxedTuples #-}
-#endif
-----------------------------------------------------------------------------
-- |
@@ -78,36 +75,21 @@ data StableName a = StableName (StableName# a)
-- | Makes a 'StableName' for an arbitrary object. The object passed as
-- the first argument is not evaluated by 'makeStableName'.
makeStableName :: a -> IO (StableName a)
-#if defined(__PARALLEL_HASKELL__)
-makeStableName a =
- error "makeStableName not implemented in parallel Haskell"
-#else
makeStableName a = IO $ \ s ->
case makeStableName# a s of (# s', sn #) -> (# s', StableName sn #)
-#endif
-- | Convert a 'StableName' to an 'Int'. The 'Int' returned is not
-- necessarily unique; several 'StableName's may map to the same 'Int'
-- (in practice however, the chances of this are small, so the result
-- of 'hashStableName' makes a good hash key).
hashStableName :: StableName a -> Int
-#if defined(__PARALLEL_HASKELL__)
-hashStableName (StableName sn) =
- error "hashStableName not implemented in parallel Haskell"
-#else
hashStableName (StableName sn) = I# (stableNameToInt# sn)
-#endif
instance Eq (StableName a) where
-#if defined(__PARALLEL_HASKELL__)
- (StableName sn1) == (StableName sn2) =
- error "eqStableName not implemented in parallel Haskell"
-#else
(StableName sn1) == (StableName sn2) =
case eqStableName# sn1 sn2 of
0# -> False
_ -> True
-#endif
-- | Equality on 'StableName' that does not require that the types of
-- the arguments match.
diff --git a/libraries/base/tests/Memo1.lhs b/libraries/base/tests/Memo1.lhs
index b723480d4d..40e070058a 100644
--- a/libraries/base/tests/Memo1.lhs
+++ b/libraries/base/tests/Memo1.lhs
@@ -5,18 +5,13 @@
% Hashing memo tables.
\begin{code}
-{-# LANGUAGE CPP #-}
module Memo1
-#ifndef __PARALLEL_HASKELL__
( memo -- :: (a -> b) -> a -> b
, memoSized -- :: Int -> (a -> b) -> a -> b
)
-#endif
where
-#ifndef __PARALLEL_HASKELL__
-
import System.Mem.StableName ( StableName, makeStableName, hashStableName )
import System.Mem.Weak ( Weak, mkWeakPtr, mkWeak, deRefWeak, finalize )
import Data.Array.IO ( IOArray, newArray, readArray, writeArray )
@@ -137,5 +132,4 @@ lookupSN sn (MemoEntry sn' weak : xs)
show (hashStableName sn))
Just v -> return (Just v)
| otherwise = lookupSN sn xs
-#endif
\end{code}
diff --git a/libraries/base/tests/Memo2.lhs b/libraries/base/tests/Memo2.lhs
index 69f2992266..a834cb5ced 100644
--- a/libraries/base/tests/Memo2.lhs
+++ b/libraries/base/tests/Memo2.lhs
@@ -5,18 +5,13 @@
% Hashing memo tables.
\begin{code}
-{-# LANGUAGE CPP #-}
module Memo2
-#ifndef __PARALLEL_HASKELL__
( memo -- :: (a -> b) -> a -> b
, memoSized -- :: Int -> (a -> b) -> a -> b
)
-#endif
where
-#ifndef __PARALLEL_HASKELL__
-
import System.Mem.StableName ( StableName, makeStableName, hashStableName )
import System.Mem.Weak ( Weak, mkWeakPtr, mkWeak, deRefWeak, finalize )
import Data.Array.IO ( IOArray, newArray, readArray, writeArray )
@@ -137,5 +132,4 @@ lookupSN sn (MemoEntry sn' weak : xs)
show (hashStableName sn))
Just v -> return (Just v)
| otherwise = lookupSN sn xs
-#endif
\end{code}