Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,251
Issues
4,251
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
394
Merge Requests
394
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
378dd296
Commit
378dd296
authored
Oct 25, 2011
by
dterei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update base for latest Safe Haskell.
parent
c9dceb6d
Changes
130
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
130 changed files
with
231 additions
and
80 deletions
+231
-80
libraries/base/Control/Monad/Group.hs
libraries/base/Control/Monad/Group.hs
+2
-0
libraries/base/Control/Monad/Instances.hs
libraries/base/Control/Monad/Instances.hs
+2
-0
libraries/base/Control/Monad/ST.hs
libraries/base/Control/Monad/ST.hs
+12
-14
libraries/base/Control/Monad/ST/Lazy.hs
libraries/base/Control/Monad/ST/Lazy.hs
+14
-12
libraries/base/Control/Monad/ST/Lazy/Imp.hs
libraries/base/Control/Monad/ST/Lazy/Imp.hs
+0
-1
libraries/base/Control/Monad/ST/Lazy/Unsafe.hs
libraries/base/Control/Monad/ST/Lazy/Unsafe.hs
+1
-0
libraries/base/Control/Monad/ST/Strict.hs
libraries/base/Control/Monad/ST/Strict.hs
+0
-10
libraries/base/Control/Monad/ST/Unsafe.hs
libraries/base/Control/Monad/ST/Unsafe.hs
+1
-0
libraries/base/Control/Monad/Zip.hs
libraries/base/Control/Monad/Zip.hs
+2
-0
libraries/base/Data/Bits.hs
libraries/base/Data/Bits.hs
+0
-1
libraries/base/Data/Bool.hs
libraries/base/Data/Bool.hs
+1
-0
libraries/base/Data/Char.hs
libraries/base/Data/Char.hs
+1
-0
libraries/base/Data/Complex.hs
libraries/base/Data/Complex.hs
+1
-0
libraries/base/Data/Data.hs
libraries/base/Data/Data.hs
+0
-1
libraries/base/Data/Dynamic.hs
libraries/base/Data/Dynamic.hs
+1
-0
libraries/base/Data/Eq.hs
libraries/base/Data/Eq.hs
+1
-0
libraries/base/Data/Fixed.hs
libraries/base/Data/Fixed.hs
+2
-1
libraries/base/Data/Foldable.hs
libraries/base/Data/Foldable.hs
+3
-0
libraries/base/Data/Function.hs
libraries/base/Data/Function.hs
+4
-0
libraries/base/Data/Functor.hs
libraries/base/Data/Functor.hs
+1
-0
libraries/base/Data/HashTable.hs
libraries/base/Data/HashTable.hs
+1
-0
libraries/base/Data/IORef.hs
libraries/base/Data/IORef.hs
+1
-0
libraries/base/Data/Int.hs
libraries/base/Data/Int.hs
+1
-0
libraries/base/Data/Ix.hs
libraries/base/Data/Ix.hs
+1
-0
libraries/base/Data/List.hs
libraries/base/Data/List.hs
+1
-0
libraries/base/Data/Maybe.hs
libraries/base/Data/Maybe.hs
+1
-0
libraries/base/Data/Monoid.hs
libraries/base/Data/Monoid.hs
+2
-0
libraries/base/Data/Ord.hs
libraries/base/Data/Ord.hs
+1
-0
libraries/base/Data/Ratio.hs
libraries/base/Data/Ratio.hs
+1
-0
libraries/base/Data/STRef.hs
libraries/base/Data/STRef.hs
+1
-0
libraries/base/Data/STRef/Lazy.hs
libraries/base/Data/STRef/Lazy.hs
+6
-3
libraries/base/Data/STRef/Strict.hs
libraries/base/Data/STRef/Strict.hs
+2
-0
libraries/base/Data/String.hs
libraries/base/Data/String.hs
+1
-0
libraries/base/Data/Traversable.hs
libraries/base/Data/Traversable.hs
+3
-0
libraries/base/Data/Tuple.hs
libraries/base/Data/Tuple.hs
+1
-0
libraries/base/Data/Typeable/Internal.hs
libraries/base/Data/Typeable/Internal.hs
+1
-0
libraries/base/Data/Typeable/Internal.hs-boot
libraries/base/Data/Typeable/Internal.hs-boot
+1
-0
libraries/base/Data/Word.hs
libraries/base/Data/Word.hs
+1
-0
libraries/base/Debug/Trace.hs
libraries/base/Debug/Trace.hs
+1
-0
libraries/base/Foreign.hs
libraries/base/Foreign.hs
+0
-8
libraries/base/Foreign/C.hs
libraries/base/Foreign/C.hs
+1
-0
libraries/base/Foreign/C/Error.hs
libraries/base/Foreign/C/Error.hs
+1
-0
libraries/base/Foreign/C/String.hs
libraries/base/Foreign/C/String.hs
+1
-0
libraries/base/Foreign/C/Types.hs
libraries/base/Foreign/C/Types.hs
+1
-0
libraries/base/Foreign/ForeignPtr.hs
libraries/base/Foreign/ForeignPtr.hs
+30
-10
libraries/base/Foreign/ForeignPtr/Imp.hs
libraries/base/Foreign/ForeignPtr/Imp.hs
+1
-0
libraries/base/Foreign/Marshal/Alloc.hs
libraries/base/Foreign/Marshal/Alloc.hs
+1
-0
libraries/base/Foreign/Marshal/Array.hs
libraries/base/Foreign/Marshal/Array.hs
+1
-0
libraries/base/Foreign/Marshal/Error.hs
libraries/base/Foreign/Marshal/Error.hs
+1
-0
libraries/base/Foreign/Marshal/Pool.hs
libraries/base/Foreign/Marshal/Pool.hs
+1
-0
libraries/base/Foreign/Marshal/Utils.hs
libraries/base/Foreign/Marshal/Utils.hs
+1
-0
libraries/base/Foreign/Ptr.hs
libraries/base/Foreign/Ptr.hs
+1
-0
libraries/base/Foreign/StablePtr.hs
libraries/base/Foreign/StablePtr.hs
+1
-0
libraries/base/Foreign/Storable.hs
libraries/base/Foreign/Storable.hs
+1
-0
libraries/base/GHC/Conc/IO.hs
libraries/base/GHC/Conc/IO.hs
+1
-1
libraries/base/GHC/Conc/Windows.hs
libraries/base/GHC/Conc/Windows.hs
+2
-1
libraries/base/GHC/Constants.hs
libraries/base/GHC/Constants.hs
+1
-0
libraries/base/GHC/Desugar.hs
libraries/base/GHC/Desugar.hs
+1
-0
libraries/base/GHC/Enum.lhs
libraries/base/GHC/Enum.lhs
+1
-0
libraries/base/GHC/Event.hs
libraries/base/GHC/Event.hs
+6
-0
libraries/base/GHC/Event/Array.hs
libraries/base/GHC/Event/Array.hs
+2
-1
libraries/base/GHC/Event/Clock.hsc
libraries/base/GHC/Event/Clock.hsc
+2
-1
libraries/base/GHC/Event/Control.hs
libraries/base/GHC/Event/Control.hs
+1
-0
libraries/base/GHC/Event/EPoll.hsc
libraries/base/GHC/Event/EPoll.hsc
+7
-3
libraries/base/GHC/Event/IntMap.hs
libraries/base/GHC/Event/IntMap.hs
+3
-1
libraries/base/GHC/Event/KQueue.hsc
libraries/base/GHC/Event/KQueue.hsc
+2
-1
libraries/base/GHC/Event/Manager.hs
libraries/base/GHC/Event/Manager.hs
+1
-1
libraries/base/GHC/Event/PSQ.hs
libraries/base/GHC/Event/PSQ.hs
+2
-1
libraries/base/GHC/Event/Poll.hsc
libraries/base/GHC/Event/Poll.hsc
+1
-1
libraries/base/GHC/Event/Thread.hs
libraries/base/GHC/Event/Thread.hs
+1
-1
libraries/base/GHC/Event/Unique.hs
libraries/base/GHC/Event/Unique.hs
+2
-1
libraries/base/GHC/Exception.lhs
libraries/base/GHC/Exception.lhs
+1
-0
libraries/base/GHC/Fingerprint.hs
libraries/base/GHC/Fingerprint.hs
+3
-1
libraries/base/GHC/Fingerprint/Type.hs
libraries/base/GHC/Fingerprint/Type.hs
+1
-0
libraries/base/GHC/Float/ConversionUtils.hs
libraries/base/GHC/Float/ConversionUtils.hs
+2
-0
libraries/base/GHC/Float/RealFracMethods.hs
libraries/base/GHC/Float/RealFracMethods.hs
+2
-0
libraries/base/GHC/Foreign.hs
libraries/base/GHC/Foreign.hs
+1
-0
libraries/base/GHC/Handle.hs
libraries/base/GHC/Handle.hs
+1
-1
libraries/base/GHC/IO.hs
libraries/base/GHC/IO.hs
+2
-0
libraries/base/GHC/IO.hs-boot
libraries/base/GHC/IO.hs-boot
+1
-0
libraries/base/GHC/IO/Buffer.hs
libraries/base/GHC/IO/Buffer.hs
+1
-0
libraries/base/GHC/IO/BufferedIO.hs
libraries/base/GHC/IO/BufferedIO.hs
+1
-0
libraries/base/GHC/IO/Device.hs
libraries/base/GHC/IO/Device.hs
+1
-0
libraries/base/GHC/IO/Encoding.hs
libraries/base/GHC/IO/Encoding.hs
+1
-0
libraries/base/GHC/IO/Encoding.hs-boot
libraries/base/GHC/IO/Encoding.hs-boot
+2
-0
libraries/base/GHC/IO/Encoding/CodePage.hs
libraries/base/GHC/IO/Encoding/CodePage.hs
+2
-0
libraries/base/GHC/IO/Encoding/Failure.hs
libraries/base/GHC/IO/Encoding/Failure.hs
+2
-0
libraries/base/GHC/IO/Encoding/Iconv.hs
libraries/base/GHC/IO/Encoding/Iconv.hs
+1
-0
libraries/base/GHC/IO/Encoding/Latin1.hs
libraries/base/GHC/IO/Encoding/Latin1.hs
+1
-0
libraries/base/GHC/IO/Encoding/Types.hs
libraries/base/GHC/IO/Encoding/Types.hs
+1
-0
libraries/base/GHC/IO/Encoding/UTF16.hs
libraries/base/GHC/IO/Encoding/UTF16.hs
+1
-0
libraries/base/GHC/IO/Encoding/UTF32.hs
libraries/base/GHC/IO/Encoding/UTF32.hs
+1
-0
libraries/base/GHC/IO/Encoding/UTF8.hs
libraries/base/GHC/IO/Encoding/UTF8.hs
+1
-0
libraries/base/GHC/IO/Exception.hs
libraries/base/GHC/IO/Exception.hs
+2
-0
libraries/base/GHC/IO/Exception.hs-boot
libraries/base/GHC/IO/Exception.hs-boot
+2
-0
libraries/base/GHC/IO/FD.hs
libraries/base/GHC/IO/FD.hs
+2
-1
libraries/base/GHC/IO/Handle.hs
libraries/base/GHC/IO/Handle.hs
+1
-0
libraries/base/GHC/IO/Handle.hs-boot
libraries/base/GHC/IO/Handle.hs-boot
+1
-0
libraries/base/GHC/IO/Handle/FD.hs-boot
libraries/base/GHC/IO/Handle/FD.hs-boot
+2
-0
libraries/base/GHC/IO/Handle/Internals.hs
libraries/base/GHC/IO/Handle/Internals.hs
+1
-0
libraries/base/GHC/IO/Handle/Text.hs
libraries/base/GHC/IO/Handle/Text.hs
+1
-0
libraries/base/GHC/IO/Handle/Types.hs
libraries/base/GHC/IO/Handle/Types.hs
+1
-0
libraries/base/GHC/IO/IOMode.hs
libraries/base/GHC/IO/IOMode.hs
+2
-0
libraries/base/GHC/IOArray.hs
libraries/base/GHC/IOArray.hs
+1
-0
libraries/base/GHC/IOBase.hs
libraries/base/GHC/IOBase.hs
+1
-1
libraries/base/GHC/IORef.hs
libraries/base/GHC/IORef.hs
+1
-0
libraries/base/GHC/Int.hs
libraries/base/GHC/Int.hs
+1
-0
libraries/base/GHC/PArr.hs
libraries/base/GHC/PArr.hs
+1
-0
libraries/base/GHC/Unicode.hs-boot
libraries/base/GHC/Unicode.hs-boot
+1
-0
libraries/base/GHC/Word.hs
libraries/base/GHC/Word.hs
+1
-0
libraries/base/System/CPUTime.hsc
libraries/base/System/CPUTime.hsc
+1
-0
libraries/base/System/Console/GetOpt.hs
libraries/base/System/Console/GetOpt.hs
+2
-0
libraries/base/System/Environment.hs
libraries/base/System/Environment.hs
+1
-0
libraries/base/System/Exit.hs
libraries/base/System/Exit.hs
+1
-0
libraries/base/System/IO.hs
libraries/base/System/IO.hs
+1
-0
libraries/base/System/IO/Error.hs
libraries/base/System/IO/Error.hs
+1
-0
libraries/base/System/Info.hs
libraries/base/System/Info.hs
+1
-0
libraries/base/System/Mem.hs
libraries/base/System/Mem.hs
+1
-1
libraries/base/System/Mem/StableName.hs
libraries/base/System/Mem/StableName.hs
+1
-0
libraries/base/System/Mem/Weak.hs
libraries/base/System/Mem/Weak.hs
+1
-0
libraries/base/System/Posix/Internals.hs
libraries/base/System/Posix/Internals.hs
+1
-0
libraries/base/System/Posix/Internals.hs-boot
libraries/base/System/Posix/Internals.hs-boot
+1
-0
libraries/base/System/Timeout.hs
libraries/base/System/Timeout.hs
+1
-0
libraries/base/Text/ParserCombinators/ReadP.hs
libraries/base/Text/ParserCombinators/ReadP.hs
+1
-0
libraries/base/Text/ParserCombinators/ReadPrec.hs
libraries/base/Text/ParserCombinators/ReadPrec.hs
+1
-0
libraries/base/Text/Printf.hs
libraries/base/Text/Printf.hs
+1
-0
libraries/base/Text/Read/Lex.hs
libraries/base/Text/Read/Lex.hs
+1
-0
libraries/base/Text/Show.hs
libraries/base/Text/Show.hs
+1
-0
libraries/base/Text/Show/Functions.hs
libraries/base/Text/Show/Functions.hs
+1
-0
libraries/base/Unsafe/Coerce.hs
libraries/base/Unsafe/Coerce.hs
+3
-0
No files found.
libraries/base/Control/Monad/Group.hs
View file @
378dd296
{-# 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
libraries/base/Control/Monad/Instances.hs
View file @
378dd296
...
...
@@ -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
libraries/base/Control/Monad/ST.hs
View file @
378dd296
{-# 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
libraries/base/Control/Monad/ST/Lazy.hs
View file @
378dd296
{-# 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
libraries/base/Control/Monad/ST/Lazy/Imp.hs
View file @
378dd296
...
...
@@ -160,4 +160,3 @@ unsafeInterleaveST = strictToLazyST . ST.unsafeInterleaveST . lazyToStrictST
unsafeIOToST
::
IO
a
->
ST
s
a
unsafeIOToST
=
strictToLazyST
.
ST
.
unsafeIOToST
libraries/base/Control/Monad/ST/Lazy/Unsafe.hs
View file @
378dd296
{-# LANGUAGE Unsafe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST.Lazy.Unsafe
...
...
libraries/base/Control/Monad/ST/Strict.hs
View file @
378dd296
{-# 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
libraries/base/Control/Monad/ST/Unsafe.hs
View file @
378dd296
{-# LANGUAGE Unsafe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST.Unsafe
...
...
libraries/base/Control/Monad/Zip.hs
View file @
378dd296
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.Zip
...
...
@@ -51,3 +52,4 @@ instance MonadZip [] where
mzip
=
zip
mzipWith
=
zipWith
munzip
=
unzip
libraries/base/Data/Bits.hs
View file @
378dd296
...
...
@@ -380,5 +380,4 @@ own to enable constant folding; for example 'shift':
10000000 -> ww_sOb
}
-}
libraries/base/Data/Bool.hs
View file @
378dd296
...
...
@@ -39,3 +39,4 @@ import Prelude
,
otherwise
)
#
endif
libraries/base/Data/Char.hs
View file @
378dd296
...
...
@@ -209,3 +209,4 @@ isSeparator c = case generalCategory c of
toTitle
::
Char
->
Char
toTitle
=
toUpper
#
endif
libraries/base/Data/Complex.hs
View file @
378dd296
...
...
@@ -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
))
libraries/base/Data/Data.hs
View file @
378dd296
...
...
@@ -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
(
...
...
libraries/base/Data/Dynamic.hs
View file @
378dd296
...
...
@@ -168,3 +168,4 @@ dynApp f x = case dynApply f x of
dynTypeRep
::
Dynamic
->
TypeRep
dynTypeRep
(
Dynamic
tr
_
)
=
tr
libraries/base/Data/Eq.hs
View file @
378dd296
...
...
@@ -22,3 +22,4 @@ module Data.Eq (
#
if
__GLASGOW_HASKELL__
import
GHC.Base
#
endif
libraries/base/Data/Fixed.hs
View file @
378dd296
{-# 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
libraries/base/Data/Foldable.hs
View file @
378dd296
...
...
@@ -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
[]
)
libraries/base/Data/Function.hs
View file @
378dd296
{-# 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
libraries/base/Data/Functor.hs
View file @
378dd296
...
...
@@ -33,3 +33,4 @@ infixl 4 <$>
-- | An infix synonym for 'fmap'.
(
<$>
)
::
Functor
f
=>
(
a
->
b
)
->
f
a
->
f
b
(
<$>
)
=
fmap
libraries/base/Data/HashTable.hs
View file @
378dd296
...
...
@@ -531,3 +531,4 @@ longestChain = mapReduce id (maximumBy lengthCmp)
lengthCmp
[]
[]
=
EQ
lengthCmp
[]
_
=
LT
lengthCmp
_
[]
=
GT
libraries/base/Data/IORef.hs
View file @
378dd296
...
...
@@ -138,3 +138,4 @@ atomicModifyIORef r f =
'IORef' operations.
-}
libraries/base/Data/Int.hs
View file @
378dd296
...
...
@@ -65,3 +65,4 @@ import NHC.SizedTypes (Int8, Int16, Int32, Int64) -- instances of Bits
count to the width of the type, for example @1 \<\< 32
== 1@ in some C implementations.
-}
libraries/base/Data/Ix.hs
View file @
378dd296
...
...
@@ -16,6 +16,7 @@
-- (see the array package).
--
-----------------------------------------------------------------------------
module
Data.Ix
(
-- * The 'Ix' class
...
...
libraries/base/Data/List.hs
View file @
378dd296
...
...
@@ -1105,3 +1105,4 @@ errorEmptyList fun =
error
(
"Prelude."
++
fun
++
": empty list"
)
#
endif
/*
!
__GLASGOW_HASKELL__
*/
libraries/base/Data/Maybe.hs
View file @
378dd296
...
...
@@ -149,3 +149,4 @@ mapMaybe f (x:xs) =
Just
r
->
r
:
rs
#
endif
/*
else
not
__NHC__
*/
libraries/base/Data/Monoid.hs
View file @
378dd296
...
...
@@ -14,6 +14,7 @@
--
-- A class for monoids (types with an associative binary operation that
-- has an identity) with various general-purpose instances.
--
-----------------------------------------------------------------------------
module
Data.Monoid
(
...
...
@@ -276,3 +277,4 @@ prop_mconcatLast x =
where listLastToMaybe [] = Nothing
listLastToMaybe lst = Just (last lst)
-- -}
libraries/base/Data/Ord.hs
View file @
378dd296
...
...
@@ -34,3 +34,4 @@ import GHC.Base
-- > ... sortBy (comparing fst) ...
comparing
::
(
Ord
a
)
=>
(
b
->
a
)
->
b
->
b
->
Ordering
comparing
p
x
y
=
compare
(
p
x
)
(
p
y
)
libraries/base/Data/Ratio.hs
View file @
378dd296
...
...
@@ -95,3 +95,4 @@ approxRational rat eps = simplest (rat-eps) (rat+eps)
n''
=
numerator
nd''
d''
=
denominator
nd''
#
endif
libraries/base/Data/STRef.hs
View file @
378dd296
...
...
@@ -42,3 +42,4 @@ INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef")
-- |Mutate the contents of an 'STRef'
modifySTRef
::
STRef
s
a
->
(
a
->
a
)
->
ST
s
()
modifySTRef
ref
f
=
writeSTRef
ref
.
f
=<<
readSTRef
ref
libraries/base/Data/STRef/Lazy.hs
View file @
378dd296
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.STRef.Lazy
...
...
@@ -12,6 +13,7 @@
-- Mutable references in the lazy ST monad.
--
-----------------------------------------------------------------------------
module
Data.STRef.Lazy
(
-- * STRefs
ST
.
STRef
,
-- abstract, instance Eq
...
...
@@ -30,7 +32,8 @@ readSTRef :: ST.STRef s a -> ST s a
writeSTRef
::
ST
.
STRef
s
a
->
a
->
ST
s
()
modifySTRef
::
ST
.
STRef
s
a
->
(
a
->
a
)
->
ST
s
()
newSTRef
=
strictToLazyST
.
ST
.
newSTRef
readSTRef
=
strictToLazyST
.
ST
.
readSTRef
writeSTRef
r
a
=
strictToLazyST
(
ST
.
writeSTRef
r
a
)
newSTRef
=
strictToLazyST
.
ST
.
newSTRef
readSTRef
=
strictToLazyST
.
ST
.
readSTRef
writeSTRef
r
a
=
strictToLazyST
(
ST
.
writeSTRef
r
a
)
modifySTRef
r
f
=
strictToLazyST
(
ST
.
modifySTRef
r
f
)
libraries/base/Data/STRef/Strict.hs
View file @
378dd296
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.STRef.Strict
...
...
@@ -18,3 +19,4 @@ module Data.STRef.Strict (
)
where
import
Data.STRef
libraries/base/Data/String.hs
View file @
378dd296
...
...
@@ -41,3 +41,4 @@ class IsString a where
instance
IsString
[
Char
]
where
fromString
xs
=
xs
#
endif
libraries/base/Data/Traversable.hs
View file @
378dd296
...
...
@@ -29,6 +29,8 @@
-- functions of the same names from lists to any 'Traversable' functor.
-- To avoid ambiguity, either import the "Prelude" hiding these names
-- or qualify uses of these function names with an alias for this module.
--
-----------------------------------------------------------------------------
module
Data.Traversable
(
Traversable
(
..
),
...
...
@@ -194,3 +196,4 @@ instance Functor Id where
instance
Applicative
Id
where
pure
=
Id
Id
f
<*>
Id
x
=
Id
(
f
x
)
libraries/base/Data/Tuple.hs
View file @
378dd296
...
...
@@ -2,6 +2,7 @@
{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- XXX -fno-warn-unused-imports needed for the GHC.Tuple import below. Sigh.
-----------------------------------------------------------------------------
-- |
-- Module : Data.Tuple
...
...
libraries/base/Data/Typeable/Internal.hs
View file @
378dd296
{-# LANGUAGE Unsafe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Typeable.Internal
...
...
libraries/base/Data/Typeable/Internal.hs-boot
View file @
378dd296
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}
module
Data.Typeable.Internal
(
Typeable
(
typeOf
),
TypeRep
,
...
...
libraries/base/Data/Word.hs
View file @
378dd296
...
...
@@ -68,3 +68,4 @@ type Word = Word32
truncate the shift count to the width of the type, for example @1 \<\<
32 == 1@ in some C implementations.
-}
libraries/base/Debug/Trace.hs
View file @
378dd296
...
...
@@ -71,3 +71,4 @@ Like 'trace', but uses 'show' on the argument to convert it to a 'String'.
-}
traceShow
::
(
Show
a
)
=>
a
->
b
->
b
traceShow
=
trace
.
show
libraries/base/Foreign.hs
View file @
378dd296
#
if
sh_SAFE_DEFAULT
{-# LANGUAGE Trustworthy #-}
#
else
{-# LANGUAGE Unsafe #-}
#
endif
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
...
...
@@ -30,7 +26,6 @@ module Foreign
,
module
Foreign
.
Storable
,
module
Foreign
.
Marshal
#
if
!
sh_SAFE_DEFAULT
-- * Unsafe Functions
-- | 'unsafePerformIO' is exported here for backwards
...
...
@@ -38,7 +33,6 @@ module Foreign
-- the FFI, use 'unsafeLocalState'. For other uses, see
-- 'System.IO.Unsafe.unsafePerformIO'.
,
unsafePerformIO
#
endif
)
where
import
Data.Bits
...
...
@@ -50,7 +44,6 @@ import Foreign.StablePtr
import
Foreign.Storable
import
Foreign.Marshal
#
if
!
sh_SAFE_DEFAULT
import
GHC.IO
(
IO
)
import
qualified
System.IO.Unsafe
(
unsafePerformIO
)
...
...
@@ -59,5 +52,4 @@ import qualified System.IO.Unsafe (unsafePerformIO)
{-# INLINE unsafePerformIO #-}
unsafePerformIO
::
IO
a
->
a
unsafePerformIO
=
System
.
IO
.
Unsafe
.
unsafePerformIO
#
endif
libraries/base/Foreign/C.hs
View file @
378dd296
...
...
@@ -24,3 +24,4 @@ module Foreign.C
import
Foreign.C.Types
import
Foreign.C.String
import
Foreign.C.Error
libraries/base/Foreign/C/Error.hs
View file @
378dd296
...
...
@@ -616,3 +616,4 @@ errnoToIOError loc errno maybeHdl maybeName = unsafePerformIO $ do
#
endif
foreign
import
ccall
unsafe
"string.h"
strerror
::
Errno
->
IO
(
Ptr
CChar
)
libraries/base/Foreign/C/String.hs
View file @
378dd296
...
...
@@ -541,3 +541,4 @@ castCharToCWchar :: Char -> CWchar
castCharToCWchar
ch
=
fromIntegral
(
ord
ch
)
#
endif
/*
!
mingw32_HOST_OS
*/
libraries/base/Foreign/C/Types.hs
View file @
378dd296
...
...
@@ -331,3 +331,4 @@ INSTANCE_BITS(CIntMax)
INSTANCE_BITS
(
CUIntMax
)
#
endif
libraries/base/Foreign/ForeignPtr.hs
View file @
378dd296
{-# LANGUAGE CPP, NoImplicitPrelude #-}
#
if
sh_SAFE_DEFAULT
{-# LANGUAGE Trustworthy #-}
#
else
{-# LANGUAGE Unsafe #-}
#
endif
{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
...
...
@@ -23,16 +19,41 @@
-----------------------------------------------------------------------------
module
Foreign.ForeignPtr
(
module
Foreign
.
ForeignPtr
.
Safe
#
if
!
sh_SAFE_DEFAULT
-- * Finalised data pointers
ForeignPtr
,
FinalizerPtr
#
if
defined
(
__HUGS__
)
||
defined
(
__GLASGOW_HASKELL__
)
,
FinalizerEnvPtr
#
endif
-- ** Basic operations
,
newForeignPtr
,
newForeignPtr_
,
addForeignPtrFinalizer
#
if
defined
(
__HUGS__
)
||
defined
(
__GLASGOW_HASKELL__
)
,
newForeignPtrEnv
,
addForeignPtrFinalizerEnv
#
endif
,
withForeignPtr
#
ifdef
__GLASGOW_HASKELL__
,
finalizeForeignPtr
#
endif
-- ** Low-level operations
,
touchForeignPtr
,
castForeignPtr
-- ** Allocating managed memory
,
mallocForeignPtr
,
mallocForeignPtrBytes
,
mallocForeignPtrArray
,
mallocForeignPtrArray0
-- ** Unsafe low-level operations
,
unsafeForeignPtrToPtr
#
endif
)
where
import
Foreign.ForeignPtr.Safe
#
if
!
sh_SAFE_DEFAULT
import
Foreign.Ptr
(
Ptr
)
import
qualified
Foreign.ForeignPtr.Unsafe
as
U
...
...
@@ -40,5 +61,4 @@ import qualified Foreign.ForeignPtr.Unsafe as U
{-# INLINE unsafeForeignPtrToPtr #-}
unsafeForeignPtrToPtr
::
ForeignPtr
a
->
Ptr
a
unsafeForeignPtrToPtr
=
U
.
unsafeForeignPtrToPtr
#
endif
libraries/base/Foreign/ForeignPtr/Imp.hs
View file @
378dd296
...
...
@@ -179,3 +179,4 @@ mallocForeignPtrArray = doMalloc undefined
-- the block of memory was allocated by 'Foreign.Marshal.Alloc.malloc'.
mallocForeignPtrArray0
::
Storable
a
=>
Int
->
IO
(
ForeignPtr
a
)
mallocForeignPtrArray0
size
=
mallocForeignPtrArray
(
size
+
1
)
libraries/base/Foreign/Marshal/Alloc.hs
View file @
378dd296
...
...
@@ -245,3 +245,4 @@ foreign import ccall unsafe "stdlib.h free" _free :: Ptr a -> IO ()
-- used as a finalizer (cf 'Foreign.ForeignPtr.ForeignPtr') for storage
-- allocated with 'malloc', 'mallocBytes', 'realloc' or 'reallocBytes'.
foreign
import
ccall
unsafe
"stdlib.h &free"
finalizerFree
::
FinalizerPtr
a
libraries/base/Foreign/Marshal/Array.hs
View file @
378dd296
...
...
@@ -277,3 +277,4 @@ advancePtr = doAdvance undefined
where
doAdvance
::
Storable
a'
=>
a'
->
Ptr
a'
->
Int
->
Ptr
a'
doAdvance
dummy
ptr
i
=
ptr
`
plusPtr
`
(
i
*
sizeOf
dummy
)
libraries/base/Foreign/Marshal/Error.hs
View file @
378dd296
...
...
@@ -83,3 +83,4 @@ throwIfNull = throwIf (== nullPtr) . const
--
void
::
IO
a
->
IO
()
void
act
=
act
>>
return
()
libraries/base/Foreign/Marshal/Pool.hs
View file @
378dd296
...
...
@@ -209,3 +209,4 @@ pooledNewArray0 pool marker vals = do
ptr
<-
pooledMallocArray0
pool
(
length
vals
)
pokeArray0
marker
ptr
vals
return
ptr
libraries/base/Foreign/Marshal/Utils.hs
View file @
378dd296
...
...
@@ -178,3 +178,4 @@ moveBytes dest src size = do _ <- memmove dest src (fromIntegral size)
--
foreign
import
ccall
unsafe
"string.h"
memcpy
::
Ptr
a
->
Ptr
a
->
CSize
->
IO
(
Ptr
a
)
foreign
import
ccall
unsafe
"string.h"
memmove
::
Ptr
a
->
Ptr
a
->
CSize
->
IO
(
Ptr
a
)
libraries/base/Foreign/Ptr.hs
View file @
378dd296
...
...
@@ -162,3 +162,4 @@ foreign import ccall unsafe "__hscore_from_intptr"
#
endif
/*
!
__GLASGOW_HASKELL__
*/
#
endif
/*
!
__NHC_
*/
libraries/base/Foreign/StablePtr.hs
View file @
378dd296
...
...
@@ -61,3 +61,4 @@ import NHC.FFI
-- guarantee provided is that if they are passed back to Haskell land, the
-- function 'deRefStablePtr' will be able to reconstruct the
-- Haskell value referred to by the stable pointer.
libraries/base/Foreign/Storable.hs
View file @
378dd296
...
...
@@ -284,3 +284,4 @@ pokeFingerprint p0 (Fingerprint high low) = do
pokeW64
(
castPtr
p0
)
8
high
pokeW64
(
castPtr
p0
`
plusPtr
`
8
)
8
low
#
endif
libraries/base/GHC/Conc/IO.hs
View file @
378dd296
{-# LANGUAGE
Unsafe
#-}
{-# LANGUAGE
Trustworthy
#-}
{-# LANGUAGE CPP
, NoImplicitPrelude
, MagicHash
...
...
libraries/base/GHC/Conc/Windows.hs
View file @
378dd296
{-# LANGUAGE
Unsafe
#-}
{-# LANGUAGE
Trustworthy
#-}
{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, ForeignFunctionInterface,
DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
...
...
@@ -324,3 +324,4 @@ foreign import ccall unsafe "sendIOManagerEvent" -- in the RTS (ThrIOManager.c)
foreign
import
stdcall
"WaitForSingleObject"
c_WaitForSingleObject
::
HANDLE
->
DWORD
->
IO
DWORD
libraries/base/GHC/Constants.hs