Commit 378dd296 authored by dterei's avatar dterei
Browse files

Update base for latest Safe Haskell.

parent c9dceb6d
{-# LANGUAGE Trustworthy #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Group
......@@ -32,3 +33,4 @@ class Monad m => MonadGroup m t where
instance Ord t => MonadGroup [] t where
mgroupWith = groupWith
#endif
......@@ -2,6 +2,7 @@
{-# OPTIONS_NHC98 --prelude #-}
-- This module deliberately declares orphan instances:
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Instances
......@@ -37,3 +38,4 @@ instance Monad (Either e) where
return = Right
Left l >>= _ = Left l
Right r >>= k = k r
{-# LANGUAGE CPP #-}
#if sh_SAFE_DEFAULT
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Unsafe #-}
#endif
-----------------------------------------------------------------------------
-- |
......@@ -22,18 +17,22 @@
-----------------------------------------------------------------------------
module Control.Monad.ST (
module Control.Monad.ST.Safe
#if !sh_SAFE_DEFAULT
-- * The 'ST' Monad
ST, -- abstract, instance of Functor, Monad, Typeable.
runST, -- :: (forall s. ST s a) -> a
fixST, -- :: (a -> ST s a) -> ST s a
-- * Converting 'ST' to 'IO'
RealWorld, -- abstract
stToIO, -- :: ST RealWorld a -> IO a
-- * Unsafe Functions
, unsafeInterleaveST
, unsafeIOToST
, unsafeSTToIO
#endif
unsafeInterleaveST,
unsafeIOToST,
unsafeSTToIO
) where
import Control.Monad.ST.Safe
#if !sh_SAFE_DEFAULT
import qualified Control.Monad.ST.Unsafe as U
{-# DEPRECATED unsafeInterleaveST, unsafeIOToST, unsafeSTToIO
......@@ -51,5 +50,4 @@ unsafeIOToST = U.unsafeIOToST
{-# INLINE unsafeSTToIO #-}
unsafeSTToIO :: ST s a -> IO a
unsafeSTToIO = U.unsafeSTToIO
#endif
{-# LANGUAGE CPP #-}
#if sh_SAFE_DEFAULT
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Unsafe #-}
#endif
-----------------------------------------------------------------------------
-- |
......@@ -22,16 +17,24 @@
-----------------------------------------------------------------------------
module Control.Monad.ST.Lazy (
module Control.Monad.ST.Lazy.Safe
#if !sh_SAFE_DEFAULT
-- * The 'ST' monad
ST,
runST,
fixST,
-- * Converting between strict and lazy 'ST'
strictToLazyST, lazyToStrictST,
-- * Converting 'ST' To 'IO'
RealWorld,
stToIO,
-- * Unsafe Functions
, unsafeInterleaveST
, unsafeIOToST
#endif
unsafeInterleaveST,
unsafeIOToST
) where
import Control.Monad.ST.Lazy.Safe
#if !sh_SAFE_DEFAULT
import qualified Control.Monad.ST.Lazy.Unsafe as U
{-# DEPRECATED unsafeInterleaveST, unsafeIOToST
......@@ -45,5 +48,4 @@ unsafeInterleaveST = U.unsafeInterleaveST
{-# INLINE unsafeIOToST #-}
unsafeIOToST :: IO a -> ST s a
unsafeIOToST = U.unsafeIOToST
#endif
......@@ -160,4 +160,3 @@ unsafeInterleaveST = strictToLazyST . ST.unsafeInterleaveST . lazyToStrictST
unsafeIOToST :: IO a -> ST s a
unsafeIOToST = strictToLazyST . ST.unsafeIOToST
{-# LANGUAGE Unsafe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST.Lazy.Unsafe
......
{-# LANGUAGE CPP #-}
#if sh_SAFE_DEFAULT
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Unsafe #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST.Strict
......@@ -22,9 +16,5 @@ module Control.Monad.ST.Strict (
module Control.Monad.ST
) where
#if sh_SAFE_DEFAULT
import safe Control.Monad.ST
#else
import Control.Monad.ST
#endif
{-# LANGUAGE Unsafe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST.Unsafe
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Zip
......@@ -51,3 +52,4 @@ instance MonadZip [] where
mzip = zip
mzipWith = zipWith
munzip = unzip
......@@ -380,5 +380,4 @@ own to enable constant folding; for example 'shift':
10000000 -> ww_sOb
}
-}
......@@ -39,3 +39,4 @@ import Prelude
, otherwise
)
#endif
......@@ -209,3 +209,4 @@ isSeparator c = case generalCategory c of
toTitle :: Char -> Char
toTitle = toUpper
#endif
......@@ -205,3 +205,4 @@ instance (RealFloat a) => Floating (Complex a) where
asinh z = log (z + sqrt (1+z*z))
acosh z = log (z + (z+1) * sqrt ((z-1)/(z+1)))
atanh z = 0.5 * log ((1.0+z) / (1.0-z))
......@@ -23,7 +23,6 @@
-- For more information, please visit the new
-- SYB wiki: <http://www.cs.uu.nl/wiki/bin/view/GenericProgramming/SYB>.
--
--
-----------------------------------------------------------------------------
module Data.Data (
......
......@@ -168,3 +168,4 @@ dynApp f x = case dynApply f x of
dynTypeRep :: Dynamic -> TypeRep
dynTypeRep (Dynamic tr _) = tr
......@@ -22,3 +22,4 @@ module Data.Eq (
#if __GLASGOW_HASKELL__
import GHC.Base
#endif
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS -Wall -fno-warn-unused-binds #-}
#ifndef __NHC__
{-# LANGUAGE DeriveDataTypeable #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.Fixed
......@@ -246,3 +246,4 @@ instance HasResolution E12 where
resolution _ = 1000000000000
-- | resolution of 10^-12 = .000000000001
type Pico = Fixed E12
......@@ -18,6 +18,8 @@
-- functor. To avoid ambiguity, either import those modules hiding
-- these names or qualify uses of these function names with an alias
-- for this module.
--
-----------------------------------------------------------------------------
module Data.Foldable (
-- * Folds
......@@ -320,3 +322,4 @@ notElem x = not . elem x
-- 'Nothing' if there is no such element.
find :: Foldable t => (a -> Bool) -> t a -> Maybe a
find p = listToMaybe . concatMap (\ x -> if p x then [x] else [])
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Function
......@@ -10,6 +11,8 @@
-- Portability : portable
--
-- Simple combinators working solely on and with functions.
--
-----------------------------------------------------------------------------
module Data.Function
( -- * "Prelude" re-exports
......@@ -82,3 +85,4 @@ fix f = let x = f x in x
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
(.*.) `on` f = \x y -> f x .*. f y
......@@ -33,3 +33,4 @@ infixl 4 <$>
-- | An infix synonym for 'fmap'.
(<$>) :: Functor f => (a -> b) -> f a -> f b
(<$>) = fmap
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment