ghc.git
7 years agoReplace createDirectoryHierarchy with createDirectoryIfMissing True
Takano Akio [Wed, 22 Feb 2012 02:18:29 +0000 (10:18 +0800)] 
Replace createDirectoryHierarchy with createDirectoryIfMissing True

createDirectoryHierarchy consisted of an existence test followed by
createDirectory, which failed if that directory was creted just after
the test. createDirectoryifMissing does not have this problem.

7 years agotyops
Gabor Greif [Sun, 22 Jan 2012 22:41:08 +0000 (23:41 +0100)] 
tyops

7 years agoformatting tweaks
Gabor Greif [Thu, 19 Jan 2012 14:02:34 +0000 (15:02 +0100)] 
formatting tweaks

7 years ago(some) tabs -> spaces
Gabor Greif [Wed, 18 Jan 2012 17:06:47 +0000 (18:06 +0100)] 
(some) tabs -> spaces

7 years agotabs -> spaces
Gabor Greif [Thu, 19 Jan 2012 13:54:02 +0000 (14:54 +0100)] 
tabs -> spaces

7 years ago(some) tabs -> spaces
Gabor Greif [Wed, 18 Jan 2012 17:05:32 +0000 (18:05 +0100)] 
(some) tabs -> spaces

7 years ago(some) tabs -> spaces
Gabor Greif [Wed, 18 Jan 2012 17:03:40 +0000 (18:03 +0100)] 
(some) tabs -> spaces

7 years agozap extra semi
Gabor Greif [Wed, 18 Jan 2012 17:02:51 +0000 (18:02 +0100)] 
zap extra semi

7 years agotypo
Gabor Greif [Wed, 18 Jan 2012 00:51:40 +0000 (01:51 +0100)] 
typo

7 years agocomments only
Gabor Greif [Wed, 18 Jan 2012 00:14:56 +0000 (01:14 +0100)] 
comments only

7 years agotypo
Gabor Greif [Mon, 16 Jan 2012 23:03:11 +0000 (00:03 +0100)] 
typo

7 years agotypo
Gabor Greif [Sun, 15 Jan 2012 00:20:05 +0000 (01:20 +0100)] 
typo

7 years agosome small corrections
Gabor Greif [Fri, 13 Jan 2012 00:32:45 +0000 (01:32 +0100)] 
some small corrections

7 years agotwo typos
Gabor Greif [Thu, 12 Jan 2012 19:13:44 +0000 (20:13 +0100)] 
two typos

7 years agominor tweak
Gabor Greif [Thu, 12 Jan 2012 17:35:52 +0000 (18:35 +0100)] 
minor tweak

7 years agotypo
Gabor Greif [Thu, 12 Jan 2012 00:43:49 +0000 (01:43 +0100)] 
typo

7 years agoremove legacy clean
Gabor Greif [Wed, 11 Jan 2012 17:06:56 +0000 (18:06 +0100)] 
remove legacy clean

7 years agouse idiomatic (GHC) types
Gabor Greif [Mon, 9 Jan 2012 22:06:58 +0000 (23:06 +0100)] 
use idiomatic (GHC) types

7 years agotidied this up, the macro definitions were causing duplicate semis in the source
Gabor Greif [Mon, 9 Jan 2012 21:00:39 +0000 (22:00 +0100)] 
tidied this up, the macro definitions were causing duplicate semis in the source

7 years agoremove unused function: printError
Simon Marlow [Mon, 27 Feb 2012 11:49:55 +0000 (11:49 +0000)] 
remove unused function: printError

7 years agoFix warnings in utils/GraphColor.hs
Ian Lynagh [Sun, 26 Feb 2012 17:54:04 +0000 (17:54 +0000)] 
Fix warnings in utils/GraphColor.hs

7 years agoWhitespace only in utils/GraphColor.hs
Ian Lynagh [Sun, 26 Feb 2012 17:51:29 +0000 (17:51 +0000)] 
Whitespace only in utils/GraphColor.hs

7 years agoChange -X flags into LANGUAGE pragmas
Ian Lynagh [Sun, 26 Feb 2012 17:37:38 +0000 (17:37 +0000)] 
Change -X flags into LANGUAGE pragmas

7 years agoFix warnings in utils/GraphOps.hs
Ian Lynagh [Sun, 26 Feb 2012 17:25:52 +0000 (17:25 +0000)] 
Fix warnings in utils/GraphOps.hs

7 years agoWhitespace only in utils/GraphOps.hs
Ian Lynagh [Sun, 26 Feb 2012 17:19:30 +0000 (17:19 +0000)] 
Whitespace only in utils/GraphOps.hs

7 years agoImplement "value" imports with the CAPI
Ian Lynagh [Sun, 26 Feb 2012 01:46:06 +0000 (01:46 +0000)] 
Implement "value" imports with the CAPI

This allows us to import values (i.e. non-functions) with the CAPI.
This means we can access values even if (on some or all platforms)
they are simple #defines.

7 years agoFix parsing of FFI import decls
Ian Lynagh [Sat, 25 Feb 2012 19:13:55 +0000 (19:13 +0000)] 
Fix parsing of FFI import decls

We no longer parse "staticfoo" as "static foo".

7 years agoAbstract out the hFlush calls in the GHC API
Ian Lynagh [Fri, 24 Feb 2012 22:49:14 +0000 (22:49 +0000)] 
Abstract out the hFlush calls in the GHC API

stdout/stderr might be closed, so we can't just hFlush them.
So we instead allow configuration in the same way that log_action
is configurable.

7 years agoAdd x86 implementations of the quotRem, Mul2 and Add2 primops
Ian Lynagh [Fri, 24 Feb 2012 14:09:09 +0000 (14:09 +0000)] 
Add x86 implementations of the quotRem, Mul2 and Add2 primops

7 years agoFix generic 2-word-multiply
Ian Lynagh [Fri, 24 Feb 2012 01:49:41 +0000 (01:49 +0000)] 
Fix generic 2-word-multiply

7 years agoImplement 2-word-multiply for x86_64
Ian Lynagh [Fri, 24 Feb 2012 00:56:26 +0000 (00:56 +0000)] 
Implement 2-word-multiply for x86_64

7 years agoAdd a 2-word-multiply operator
Ian Lynagh [Fri, 24 Feb 2012 00:34:46 +0000 (00:34 +0000)] 
Add a 2-word-multiply operator

Currently no NCGs support it

7 years agoAdd x86_64 support for the add-with-carry op
Ian Lynagh [Thu, 23 Feb 2012 21:36:10 +0000 (21:36 +0000)] 
Add x86_64 support for the add-with-carry op

7 years agoAdd a Word add-with-carry primop
Ian Lynagh [Thu, 23 Feb 2012 19:57:57 +0000 (19:57 +0000)] 
Add a Word add-with-carry primop

No special-casing in any NCGs yet

7 years agoCall expandCallishMachOp in the x86_64 codegen too
Ian Lynagh [Thu, 23 Feb 2012 15:25:51 +0000 (15:25 +0000)] 
Call expandCallishMachOp in the x86_64 codegen too

Currently it does nothing, as x86_64 supports all the callishMachOps
that expandCallishMachOp expands, but it might be needed in the future.

7 years agoUpdate dependencies
Ian Lynagh [Wed, 22 Feb 2012 22:30:20 +0000 (22:30 +0000)] 
Update dependencies

7 years agoUpdate dependencies
Ian Lynagh [Wed, 22 Feb 2012 19:10:24 +0000 (19:10 +0000)] 
Update dependencies

7 years agoSimplified serialization of IfaceTyCon, again
Max Bolingbroke [Wed, 22 Feb 2012 15:53:10 +0000 (15:53 +0000)] 
Simplified serialization of IfaceTyCon, again

Jose's patch implementing kind-polymorphic core (09015be8d580bc33f5f1960c8e31d00ba7a459a1) reverted many of the simplifying changes to interface file TyCon serialization I had made in a previous patch (5d7173f9ab8405511f75765e0541a04796d9bd07). Based on the diff I think this was an unintended consequence of how Jose did the merge rather than a real change he intended to make.

In fact, as a result of kind-polymorphic core we don't need to treat the Any TyCon specially any longer so my old simplifying changes can be made even simpler: IfaceTyCon is now just a newtype on IfaceExtName.

7 years agoFix validating with HADDOCK_DOCS=YES
Ian Lynagh [Wed, 22 Feb 2012 02:36:51 +0000 (02:36 +0000)] 
Fix validating with HADDOCK_DOCS=YES

7 years agoRemove support for CTYPE pragmas on type synonyms
Ian Lynagh [Tue, 21 Feb 2012 23:03:41 +0000 (23:03 +0000)] 
Remove support for CTYPE pragmas on type synonyms

It's not clear whether it's desirable or not, and it turns out that
the way we use coercions in GHC means we tend to lose information
about type synonyms.

7 years agoAdd a hack to make validating with HADDOCK_DOCS=NO work
Ian Lynagh [Tue, 21 Feb 2012 21:29:52 +0000 (21:29 +0000)] 
Add a hack to make validating with HADDOCK_DOCS=NO work

I've also renamed the bindisttest install directory to contain multiple
spaces, so we are also testing that multiple spaces aren't getting
collapsed into a single space.

7 years agoBe stricter about abstract newtypes in FFI declarations again.
Ian Lynagh [Tue, 21 Feb 2012 19:55:09 +0000 (19:55 +0000)] 
Be stricter about abstract newtypes in FFI declarations again.

This reverts the relaxation in c6b0fd62fc715aa6c666eb8afe09073ac7b87a83

7 years agoShow the CType in --show-iface output
Ian Lynagh [Tue, 21 Feb 2012 19:19:55 +0000 (19:19 +0000)] 
Show the CType in --show-iface output

7 years agoGHC trees no longer include the extensible-exceptions package
Ian Lynagh [Tue, 21 Feb 2012 14:58:33 +0000 (14:58 +0000)] 
GHC trees no longer include the extensible-exceptions package

7 years agoAdd a primop for unsigned quotRem; part of #5598
Ian Lynagh [Fri, 17 Feb 2012 22:46:27 +0000 (22:46 +0000)] 
Add a primop for unsigned quotRem; part of #5598

Only amd64 has an efficient implementation currently.

7 years agoSmall refactor
Ian Lynagh [Fri, 17 Feb 2012 21:15:23 +0000 (21:15 +0000)] 
Small refactor

Moved the default case of genCCall64 out into a separate function

7 years agoSmall refactoring: Use (Maybe Header) rather than FastString
Ian Lynagh [Fri, 17 Feb 2012 20:56:11 +0000 (20:56 +0000)] 
Small refactoring: Use (Maybe Header) rather than FastString

7 years agoAdd some docs for the CAPI extension
Ian Lynagh [Fri, 17 Feb 2012 18:39:11 +0000 (18:39 +0000)] 
Add some docs for the CAPI extension

7 years agoAllow a header to be specified in a CTYPE pragma
Ian Lynagh [Fri, 17 Feb 2012 15:50:59 +0000 (15:50 +0000)] 
Allow a header to be specified in a CTYPE pragma

You can now say
    data {-# CTYPE "some_header.h" "the C type" #-} Foo = ...

I think it's rare that this will actually be needed. If the
header for a CAPI FFI import includes a
    void f(ctype x);
prototype then ctype must already be defined.

However, if the header only has
    #define f(p) p->j
then the type need not be defined.

But either way, it seems good practice for us to specify the header that
we need.

7 years agoNow I understand why Constraint is a sub-kind of ArgKind!
Simon Peyton Jones [Fri, 17 Feb 2012 15:28:48 +0000 (15:28 +0000)] 
Now I understand why Constraint is a sub-kind of ArgKind!

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Fri, 17 Feb 2012 14:01:41 +0000 (14:01 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoWibble to sub-kinding
Simon Peyton Jones [Fri, 17 Feb 2012 14:00:53 +0000 (14:00 +0000)] 
Wibble to sub-kinding

7 years agoFix a missing defaultKind that resulted in lingering ArgKinds
Simon Peyton Jones [Fri, 17 Feb 2012 14:00:42 +0000 (14:00 +0000)] 
Fix a missing defaultKind that resulted in lingering ArgKinds

7 years agoFix a nasty bug in the canonicaliser which was failing
Simon Peyton Jones [Fri, 17 Feb 2012 14:00:08 +0000 (14:00 +0000)] 
Fix a nasty bug in the canonicaliser which was failing
to emit kind constraints when decomposing an application.
Resulting code is actually shorter!

7 years agoMore simplification of the sub-kinding story
Simon Peyton Jones [Fri, 17 Feb 2012 13:59:17 +0000 (13:59 +0000)] 
More simplification of the sub-kinding story

7 years agoImplement a typing rule for saturated seq, and document it
Simon Peyton Jones [Fri, 17 Feb 2012 13:57:47 +0000 (13:57 +0000)] 
Implement a typing rule for saturated seq, and document it
Also add notes about unsafeCoerce

The general thread here is to reduce use of ArgKind after
the type checker; it is so fragile!

7 years agoSubstantially nicer code in record updates
Simon Peyton Jones [Fri, 17 Feb 2012 13:56:03 +0000 (13:56 +0000)] 
Substantially nicer code in record updates

7 years agoMake the specialiser understand about polymorphic kinds
Simon Peyton Jones [Fri, 17 Feb 2012 13:55:23 +0000 (13:55 +0000)] 
Make the specialiser understand about polymorphic kinds

7 years agoDefine TypeVar (like KindVar), isTypeVar, isKindVar, and use them
Simon Peyton Jones [Fri, 17 Feb 2012 13:55:03 +0000 (13:55 +0000)] 
Define TypeVar (like KindVar), isTypeVar, isKindVar, and use them

This is the start of more global renaming

7 years agoMove sortQuantVars to MkCore
Simon Peyton Jones [Fri, 17 Feb 2012 13:52:37 +0000 (13:52 +0000)] 
Move sortQuantVars to MkCore

7 years agoKill dead code
Simon Peyton Jones [Fri, 17 Feb 2012 13:51:28 +0000 (13:51 +0000)] 
Kill dead code

7 years agoRemove unused ghciHandleGhcException
Ian Lynagh [Thu, 16 Feb 2012 22:24:28 +0000 (22:24 +0000)] 
Remove unused ghciHandleGhcException

7 years agoFix parsing regression in CTYPE patch
Ian Lynagh [Thu, 16 Feb 2012 19:31:06 +0000 (19:31 +0000)] 
Fix parsing regression in CTYPE patch

7 years agoFix the build with GHC < 7.4.1
Ian Lynagh [Thu, 16 Feb 2012 16:50:23 +0000 (16:50 +0000)] 
Fix the build with GHC < 7.4.1

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Ian Lynagh [Thu, 16 Feb 2012 16:42:01 +0000 (16:42 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

Conflicts:
compiler/types/TyCon.lhs

7 years agoAdd FunPtr to the types that toCType knows about
Ian Lynagh [Thu, 16 Feb 2012 16:24:49 +0000 (16:24 +0000)] 
Add FunPtr to the types that toCType knows about

7 years agoAdd CType informatino to wired-in types
Ian Lynagh [Thu, 16 Feb 2012 15:45:03 +0000 (15:45 +0000)] 
Add CType informatino to wired-in types

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Thu, 16 Feb 2012 13:50:39 +0000 (13:50 +0000)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoTidy up kind generalisation a bit
Simon Peyton Jones [Thu, 16 Feb 2012 13:48:25 +0000 (13:48 +0000)] 
Tidy up kind generalisation a bit

7 years agoWibbles to the ATyVar changes
Simon Peyton Jones [Thu, 16 Feb 2012 13:48:09 +0000 (13:48 +0000)] 
Wibbles to the ATyVar changes

7 years agoRejig Core Lint to deal better with polymorphic kinds
Simon Peyton Jones [Thu, 16 Feb 2012 13:47:51 +0000 (13:47 +0000)] 
Rejig Core Lint to deal better with polymorphic kinds

7 years agoTidy up the canonicaliser
Simon Peyton Jones [Thu, 16 Feb 2012 13:47:36 +0000 (13:47 +0000)] 
Tidy up the canonicaliser

I have forgotten what the original driver for this change was.
There is quite a bit of refactoring in TcCanonical; the rest
is minor.

7 years agoChange ATyVar to only have a *tyvar* not a *type* in it
Simon Peyton Jones [Thu, 16 Feb 2012 13:46:13 +0000 (13:46 +0000)] 
Change ATyVar to only have a *tyvar* not a *type* in it

This isn't really a forced change, but is a useful tidy-up

7 years agoGet rid of now-outdated zonkTypeCarefully
Simon Peyton Jones [Thu, 16 Feb 2012 13:43:36 +0000 (13:43 +0000)] 
Get rid of now-outdated zonkTypeCarefully

7 years agoComments only
Simon Peyton Jones [Thu, 16 Feb 2012 13:42:01 +0000 (13:42 +0000)] 
Comments only

7 years agoRemove dead code
Simon Peyton Jones [Thu, 16 Feb 2012 13:41:42 +0000 (13:41 +0000)] 
Remove dead code

7 years agoMainly tidying up pretty printing of types
Simon Peyton Jones [Thu, 16 Feb 2012 13:40:22 +0000 (13:40 +0000)] 
Mainly tidying up pretty printing of types

including (a) centralising Outputable.paBrackets
          (b) printing the quote on promoted TyCon/DataCon

7 years agoRefactoring around super-kinds
Simon Peyton Jones [Thu, 16 Feb 2012 13:39:13 +0000 (13:39 +0000)] 
Refactoring around super-kinds

And in particular we now have BOX :: BOX
See Note [SuperKind (BOX)] in TysPrim

7 years agoImplement the CTYPE pragma; part of the CApiFFI extension
Ian Lynagh [Wed, 15 Feb 2012 14:55:23 +0000 (14:55 +0000)] 
Implement the CTYPE pragma; part of the CApiFFI extension

For now, the syntax is
    type    {-# CTYPE "some C type" #-} Foo = ...
    newtype {-# CTYPE "some C type" #-} Foo = ...
    data    {-# CTYPE "some C type" #-} Foo = ...

7 years agoWhitespace only in types/TyCon.lhs
Ian Lynagh [Wed, 15 Feb 2012 00:48:59 +0000 (00:48 +0000)] 
Whitespace only in types/TyCon.lhs

7 years agoadd ticket number to comment
Simon Marlow [Thu, 16 Feb 2012 10:59:12 +0000 (10:59 +0000)] 
add ticket number to comment

7 years agotweak error message
Simon Marlow [Thu, 16 Feb 2012 10:53:02 +0000 (10:53 +0000)] 
tweak error message

7 years agooops, a Bool is a little *too* lax (#5878)
Simon Marlow [Thu, 16 Feb 2012 10:52:31 +0000 (10:52 +0000)] 
oops, a Bool is a little *too* lax (#5878)

7 years agopoint to the wiki for "Setting up your system for building GHC" (#5874)
Simon Marlow [Thu, 16 Feb 2012 10:37:03 +0000 (10:37 +0000)] 
point to the wiki for "Setting up your system for building GHC" (#5874)

7 years agoCompile link .note section separately from main.c
Nathan Howell [Wed, 15 Feb 2012 19:41:09 +0000 (11:41 -0800)] 
Compile link .note section separately from main.c

Fixes gas errors when -g is enabled:

Error: can't resolve `.debug-ghc-link-info' {.debug-ghc-link-info section} - `.Ltext0' {.text section}

7 years agoBe less conservative about recompiling after changes to -main-is (#5878)
Simon Marlow [Thu, 16 Feb 2012 09:34:43 +0000 (09:34 +0000)] 
Be less conservative about recompiling after changes to -main-is (#5878)

7 years agofix ARM StgCRun to not save and restore r11/fp register twice
Karel Gardas [Tue, 14 Feb 2012 07:03:07 +0000 (08:03 +0100)] 
fix ARM StgCRun to not save and restore r11/fp register twice

7 years agofix ARM's StgCRun clobbered register list for both ARM and Thumb modes
Karel Gardas [Tue, 14 Feb 2012 07:01:47 +0000 (08:01 +0100)] 
fix ARM's StgCRun clobbered register list for both ARM and Thumb modes

7 years agofix #5534 (ghci -fobject-code strangeness)
Simon Marlow [Wed, 15 Feb 2012 10:01:21 +0000 (10:01 +0000)] 
fix #5534 (ghci -fobject-code strangeness)

7 years agoDefine a quotRem CallishMachOp; fixes #5598
Ian Lynagh [Tue, 14 Feb 2012 21:26:18 +0000 (21:26 +0000)] 
Define a quotRem CallishMachOp; fixes #5598

This means we no longer do a division twice when we are using quotRem
(on platforms on which the op is supported; currently only amd64).

7 years agoAdd docbook-ised external-core doc; from #5844, by James H. Fisher
Ian Lynagh [Tue, 14 Feb 2012 14:43:08 +0000 (14:43 +0000)] 
Add docbook-ised external-core doc; from #5844, by James H. Fisher

7 years agoRemove the old ext-core docs
Ian Lynagh [Tue, 14 Feb 2012 14:47:41 +0000 (14:47 +0000)] 
Remove the old ext-core docs

They've now been merged into the user guide.

7 years agoMinor documentation fix
Simon Hengel [Tue, 14 Feb 2012 14:01:52 +0000 (15:01 +0100)] 
Minor documentation fix

Add a missing 'be' to Haddock comment of `HscTarget`.

7 years agoRefactoring: make IIModule contain ModuleName, not Module, for consistency
Simon Marlow [Tue, 14 Feb 2012 13:24:25 +0000 (13:24 +0000)] 
Refactoring: make IIModule contain ModuleName, not Module, for consistency

7 years agoRefactoring, and fix a couple of SafeHaskell-related things
Simon Marlow [Tue, 14 Feb 2012 10:24:34 +0000 (10:24 +0000)] 
Refactoring, and fix a couple of SafeHaskell-related things

When -XSafe is on:
  - ":load M" should default to adding M to the context (rather than *M).
  - "import M" should do the appropriate trust check

Also various refactoring and comments added, hopefully the code is
easier to read now.

7 years agoRevert "Don't add a bad import to the saved context."
Simon Marlow [Mon, 13 Feb 2012 13:22:20 +0000 (13:22 +0000)] 
Revert "Don't add a bad import to the saved context."

This reverts commit e5272d9bf2a65b7da8364803fcafbd2012b7de97.

Reverting to fix validate regression, and pending a redesign of the
changes.

7 years agoRevert "Have :load work under -XSafe in GHCi."
Simon Marlow [Mon, 13 Feb 2012 13:21:42 +0000 (13:21 +0000)] 
Revert "Have :load work under -XSafe in GHCi."

This reverts commit 5e9e07a33e17da01245f0cea78e6a6f8a32ac77d.

Reverting to fix validate regression, and pending a redesign of the
changes.

7 years ago.cmm files need to depend on DerivedConstants.h
Simon Marlow [Mon, 13 Feb 2012 11:18:08 +0000 (11:18 +0000)] 
.cmm files need to depend on DerivedConstants.h

7 years agoAllocate pinned object blocks from the nursery, not the global
Simon Marlow [Mon, 13 Feb 2012 11:17:50 +0000 (11:17 +0000)] 
Allocate pinned object blocks from the nursery, not the global
allocator.

Prompted by a benchmark posted to parallel-haskell@haskell.org by
Andreas Voellmy <andreas.voellmy@gmail.com>.  This program exhibits
contention for the block allocator when run with -N2 and greater
without the fix:

{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
module Main where

import Control.Monad
import Control.Concurrent
import System.Environment
import GHC.IO
import GHC.Exts
import GHC.Conc

main = do
 [m] <- fmap (fmap read) getArgs
 n <- getNumCapabilities
 ms <- replicateM n newEmptyMVar
 sequence [ forkIO $ busyWorkerB (m `quot` n) >> putMVar mv () | mv <- ms ]
 mapM takeMVar ms

busyWorkerB :: Int -> IO ()
busyWorkerB n_loops = go 0
  where go !n | n >= n_loops = return ()
              | otherwise    =
          do p <- (IO $ \s ->
                    case newPinnedByteArray# 1024# s      of
                      { (# s', mbarr# #) ->
                           (# s', () #)
                      }
                  )
             go (n+1)

7 years agoMinor documentation fix
Simon Hengel [Wed, 8 Feb 2012 07:38:35 +0000 (08:38 +0100)] 
Minor documentation fix

Add a missing 'to' to the documentation of "Safe Haskell".