haskell-directory.git
17 years agodisambiguate uses of foldr for nhc98 to compile without errors
Malcolm.Wallace@cs.york.ac.uk [Tue, 11 Jul 2006 16:16:14 +0000 (16:16 +0000)]
disambiguate uses of foldr for nhc98 to compile without errors

17 years agomake Control.Monad.Instances compilable by nhc98
Malcolm.Wallace@cs.york.ac.uk [Tue, 11 Jul 2006 16:09:41 +0000 (16:09 +0000)]
make Control.Monad.Instances compilable by nhc98

17 years agobreakpointCond
Lemmih [Sat, 8 Jul 2006 05:55:28 +0000 (05:55 +0000)]
breakpointCond

17 years agoUNDO: Merge "unrecognized long opt" fix from 6.4.2
Simon Marlow [Wed, 5 Jul 2006 14:25:37 +0000 (14:25 +0000)]
UNDO: Merge "unrecognized long opt" fix from 6.4.2
This patch undid the previous patch, "RequireOrder: do not collect
unrecognised options after a non-opt".  I asked Sven to revert it, but
didn't get an answer.

See bug #473.

17 years agoAvoid strictness in accumulator for unpackFoldr
Don Stewart [Mon, 3 Jul 2006 09:18:06 +0000 (09:18 +0000)]
Avoid strictness in accumulator for unpackFoldr

The seq on the accumulator for unpackFoldr will break in the presence of
head/build rewrite rules. The empty list case will be forced, producing
an exception. This is a known issue with seq and rewrite rules that we
just stumbled on to.

17 years agoDisable unpack/build fusion
Don Stewart [Sun, 2 Jul 2006 08:39:13 +0000 (08:39 +0000)]
Disable unpack/build fusion

unpack/build on bytestrings seems to trigger a bug when interacting with
head/build fusion in GHC.List. The bytestring001 testcase catches it.

I'll investigate further, but best to disable this for now (its not
often used anyway).

Note that with -frules-off or ghc 6.4.2 things are fine. It seems to
have emerged with the recent rules changes.

17 years agoImport Data.ByteString.Lazy, improve ByteString Fusion, and resync with FPS head
Don Stewart [Sat, 1 Jul 2006 08:43:45 +0000 (08:43 +0000)]
Import Data.ByteString.Lazy, improve ByteString Fusion, and resync with FPS head

This patch imports the Data.ByteString.Lazy module, and its helpers,
providing a ByteString implemented as a lazy list of strict cache-sized
chunks. This type allows the usual lazy operations to be written on
bytestrings, including lazy IO, with much improved space and time over
the [Char] equivalents.

17 years agoWibble in docs for new ForeignPtr functionsn
Don Stewart [Fri, 9 Jun 2006 07:59:24 +0000 (07:59 +0000)]
Wibble in docs for new ForeignPtr functionsn

17 years agocomments for Applicative and Traversable
Ross Paterson [Thu, 22 Jun 2006 17:04:36 +0000 (17:04 +0000)]
comments for Applicative and Traversable

17 years agodefault to NoBuffering on Windows for a read/write text file
Simon Marlow [Thu, 22 Jun 2006 14:44:46 +0000 (14:44 +0000)]
default to NoBuffering on Windows for a read/write text file
Fixes (works around) #679

17 years agoremove dead code
Simon Marlow [Thu, 22 Jun 2006 14:44:33 +0000 (14:44 +0000)]
remove dead code

17 years agoclarify and expand docs
Simon Marlow [Thu, 22 Jun 2006 11:29:11 +0000 (11:29 +0000)]
clarify and expand docs

17 years agoAdd minView and maxView to Map and Set
jeanphilippe.bernardy@gmail.com [Fri, 16 Jun 2006 18:01:21 +0000 (18:01 +0000)]
Add minView and maxView to Map and Set

17 years agoadd signature for registerDelay
Ross Paterson [Wed, 14 Jun 2006 11:44:56 +0000 (11:44 +0000)]
add signature for registerDelay

17 years agoa few doc comments
Ross Paterson [Tue, 13 Jun 2006 14:27:04 +0000 (14:27 +0000)]
a few doc comments

17 years agoOptimised foreign pointer representation, for heap-allocated objects
Don Stewart [Thu, 8 Jun 2006 01:50:11 +0000 (01:50 +0000)]
Optimised foreign pointer representation, for heap-allocated objects

17 years agoAdd the inline function, and many comments
simonpj@microsoft.com [Mon, 5 Jun 2006 11:58:14 +0000 (11:58 +0000)]
Add the inline function, and many comments

This commit adds the 'inline' function described in the
related patch in the compiler.

I've also added comments about the 'lazy' function.

17 years agosmall intro to exceptions
Ross Paterson [Thu, 25 May 2006 11:16:04 +0000 (11:16 +0000)]
small intro to exceptions

17 years agoexport breakpoint
Simon Marlow [Thu, 25 May 2006 09:04:56 +0000 (09:04 +0000)]
export breakpoint

17 years agoMerge in changes from fps head. Highlights:
Don Stewart [Thu, 25 May 2006 06:50:12 +0000 (06:50 +0000)]
Merge in changes from fps head. Highlights:

    Wed May 24 15:49:38 EST 2006  sjanssen@cse.unl.edu
      * instance Monoid ByteString

    Wed May 24 15:04:04 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Rearange export lists for the .Char8 modules

    Wed May 24 14:59:56 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Implement mapAccumL and reimplement mapIndexed using loopU

    Wed May 24 14:47:32 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Change the implementation of the unfoldr(N) functions.
      Use a more compact implementation for unfoldrN and change it's behaviour
      to only return Just in the case that it actually 'overflowed' the N, so
      the boundary case of unfolding exactly N gives Nothing.
      Implement unfoldr and Lazy.unfoldr in terms of unfoldrN. Use fibonacci
      growth for the chunk size in unfoldr

    Wed May 24 08:32:29 EST 2006  sjanssen@cse.unl.edu
      * Add unfoldr to ByteString and .Char8
      A preliminary implementation of unfoldr.

    Wed May 24 01:39:41 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Reorder the export lists to better match the Data.List api

    Tue May 23 14:04:32 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * pack{Byte,Char} -> singleton. As per fptools convention

    Tue May 23 14:00:51 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * elemIndexLast -> elemIndexEnd

    Tue May 23 13:57:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * In the search for a more orthogonal api, we kill breakFirst/breakLast,
        which were of dubious value

    Tue May 23 12:24:09 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Abolish elems. It's name implied it was unpack, but its type didn't. it made no sense

    Tue May 23 10:42:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Minor doc tidyup. Use haddock markup better.

    Tue May 23 11:00:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Simplify the join() implementation. Spotted by Duncan.

17 years agoadd a way to ask the IO manager thread to exit
Simon Marlow [Wed, 24 May 2006 12:18:23 +0000 (12:18 +0000)]
add a way to ask the IO manager thread to exit

17 years agoSync with FPS head, including the following patches:
Don Stewart [Sat, 20 May 2006 03:04:36 +0000 (03:04 +0000)]
Sync with FPS head, including the following patches:

    Thu May 18 15:45:46 EST 2006  sjanssen@cse.unl.edu
      * Export unsafeTake and unsafeDrop

    Fri May 19 11:53:08 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Add foldl1'

    Fri May 19 13:41:24 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Add fuseable scanl, scanl1 + properties

    Fri May 19 18:20:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Spotted another chance to use unsafeTake,Drop (in groupBy)

    Thu May 18 09:24:25 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * More effecient findIndexOrEnd based on the impl of findIndex

    Thu May 18 09:22:49 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Eliminate special case in findIndex since it's handled anyway.

    Thu May 18 09:19:08 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Add unsafeTake and unsafeDrop
      These versions assume the n is in the bounds of the bytestring, saving
      two comparison tests. Then use them in varous places where we think this
      holds. These cases need double checking (and there are a few remaining
      internal uses of take / drop that might be possible to convert).
      Not exported for the moment.

    Tue May 16 23:15:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Handle n < 0 in drop and splitAt. Spotted by QC.

    Tue May 16 22:46:22 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Handle n <= 0 cases for unfoldr and replicate. Spotted by QC

    Tue May 16 21:34:11 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * mapF -> map', filterF -> filter'

17 years agohaddock fix
Ross Paterson [Thu, 18 May 2006 15:47:23 +0000 (15:47 +0000)]
haddock fix

17 years agosimplify indexing in Data.Sequence
Ross Paterson [Thu, 18 May 2006 15:43:16 +0000 (15:43 +0000)]
simplify indexing in Data.Sequence

17 years agoMove Eq, Ord, Show instances for ThreadId to GHC.Conc
Simon Marlow [Thu, 18 May 2006 11:33:39 +0000 (11:33 +0000)]
Move Eq, Ord, Show instances for ThreadId to GHC.Conc
Eliminates orphans.

17 years agoBetter error handling in the IO manager thread
Simon Marlow [Thu, 18 May 2006 11:33:03 +0000 (11:33 +0000)]
Better error handling in the IO manager thread
In particular, handle EBADF just like rts/posix/Select.c, by waking up
all the waiting threads.  Other errors are thrown, instead of just
being ignored.

17 years ago#define _REENTRANT 1 (needed to get the right errno on some OSs)
Simon Marlow [Thu, 18 May 2006 10:41:51 +0000 (10:41 +0000)]
#define _REENTRANT 1  (needed to get the right errno on some OSs)
Part 2 of the fix for threaded RTS problems on Solaris and possibly
*BSD (Part 1 was the same change in ghc/includes/Rts.h).

17 years agocopyCString* should be in IO. Spotted by Tomasz Zielonka
Don Stewart [Thu, 18 May 2006 01:21:54 +0000 (01:21 +0000)]
copyCString* should be in IO. Spotted by Tomasz Zielonka

17 years agoadd import Prelude to get dependencies right for Data/Fixed.hs
Duncan Coutts [Wed, 17 May 2006 22:20:44 +0000 (22:20 +0000)]
add import Prelude to get dependencies right for Data/Fixed.hs
Hopefully this fixes parallel builds.

17 years agoFix negative index handling in splitAt, replicate and unfoldrN. Move mapF, filterF...
Don Stewart [Wed, 17 May 2006 02:01:50 +0000 (02:01 +0000)]
Fix negative index handling in splitAt, replicate and unfoldrN. Move mapF, filterF -> map', filter' while we're here

18 years agoUse our own realloc. Thus reduction functions (like filter) allocate on the Haskell...
Don Stewart [Sat, 13 May 2006 05:17:36 +0000 (05:17 +0000)]
Use our own realloc. Thus reduction functions (like filter) allocate on the Haskell heap. Makes around 10% difference.

18 years agoLast two CInt fixes for 64 bit, and bracket writeFile while we're here
Don Stewart [Fri, 12 May 2006 05:07:50 +0000 (05:07 +0000)]
Last two CInt fixes for 64 bit, and bracket writeFile while we're here

18 years agoSome small optimisations, generalise the type of unfold
Don Stewart [Wed, 10 May 2006 04:33:09 +0000 (04:33 +0000)]
Some small optimisations, generalise the type of unfold

    Tue May  9 22:36:29 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Surely the error function should not be inlined.

    Tue May  9 22:35:53 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Reorder memory writes for better cache locality.

    Tue May  9 23:28:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Generalise the type of unfoldrN

      The type of unfoldrN was overly constrained:
      unfoldrN :: Int -> (Word8 -> Maybe (Word8, Word8)) -> Word8 -> ByteString

      if we compare that to unfoldr:
      unfoldr :: (b -> Maybe (a, b)) -> b -> [a]

      So we can generalise unfoldrN to this type:
      unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> ByteString

      and something similar for the .Char8 version. If people really do want to
      use it a lot with Word8/Char then perhaps we should add a specialise pragma.

    Wed May 10 13:26:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Add foldl', and thus a fusion rule for length . {map,filter,fold},
      that avoids creating an array at all if the end of the pipeline is a 'length' reduction

**END OF DESCRIPTION***

Place the long patch description above the ***END OF DESCRIPTION*** marker.
The first line of this file will be the patch name.

This patch contains the following changes:

M ./Data/ByteString.hs -8 +38
M ./Data/ByteString/Char8.hs -6 +12

18 years agoportable implementation of WordPtr/IntPtr for non-GHC
Ross Paterson [Wed, 10 May 2006 00:18:26 +0000 (00:18 +0000)]
portable implementation of WordPtr/IntPtr for non-GHC

plus much tweaking of imports to avoid cycles

18 years agoadd WordPtr and IntPtr types to Foreign.Ptr, with associated conversions
Simon Marlow [Tue, 9 May 2006 09:26:06 +0000 (09:26 +0000)]
add WordPtr and IntPtr types to Foreign.Ptr, with associated conversions

As suggested by John Meacham.

I had to move the Show instance for Ptr into GHC.ForeignPtr to avoid
recursive dependencies.

18 years agoadd CIntPtr, CUIntPtr, CIntMax, CUIntMax types
Simon Marlow [Tue, 9 May 2006 09:24:27 +0000 (09:24 +0000)]
add CIntPtr, CUIntPtr, CIntMax, CUIntMax types

18 years agoadd GHC.Dynamic
Simon Marlow [Tue, 9 May 2006 08:27:39 +0000 (08:27 +0000)]
add GHC.Dynamic

18 years agoTwo things. #if defined(__GLASGOW_HASKELL__) on INLINE [n] pragmas (for jhc). And...
Don Stewart [Tue, 9 May 2006 02:34:25 +0000 (02:34 +0000)]
Two things. #if defined(__GLASGOW_HASKELL__) on INLINE [n] pragmas (for jhc). And careful use of INLINE on words/unwords halves runtime for those functions

18 years agoMake length a good consumer
simonpj@microsoft [Mon, 8 May 2006 14:27:26 +0000 (14:27 +0000)]
Make length a good consumer

Make length into a good consumer.  Fixes Trac bug #707.

(Before length simply didn't use foldr.)

18 years agoTrim imports
simonpj@microsoft [Mon, 8 May 2006 14:25:57 +0000 (14:25 +0000)]
Trim imports

18 years agoMake unsafePerformIO lazy
simonpj@microsoft [Mon, 8 May 2006 14:25:07 +0000 (14:25 +0000)]
Make unsafePerformIO lazy

The stricteness analyser used to have a HACK which ensured that NOINLNE things
were not strictness-analysed.  The reason was unsafePerformIO. Left to itself,
the strictness analyser would discover this strictness for unsafePerformIO:
unsafePerformIO:  C(U(AV))
But then consider this sub-expression
unsafePerformIO (\s -> let r = f x in
       case writeIORef v r s of (# s1, _ #) ->
       (# s1, r #)
The strictness analyser will now find that r is sure to be eval'd,
and may then hoist it out.  This makes tests/lib/should_run/memo002
deadlock.

Solving this by making all NOINLINE things have no strictness info is overkill.
In particular, it's overkill for runST, which is perfectly respectable.
Consider
f x = runST (return x)
This should be strict in x.

So the new plan is to define unsafePerformIO using the 'lazy' combinator:

unsafePerformIO (IO m) = lazy (case m realWorld# of (# _, r #) -> r)

Remember, 'lazy' is a wired-in identity-function Id, of type a->a, which is
magically NON-STRICT, and is inlined after strictness analysis.  So
unsafePerformIO will look non-strict, and that's what we want.

18 years agoSync with FPS head.
Don Stewart [Mon, 8 May 2006 12:23:22 +0000 (12:23 +0000)]
Sync with FPS head.

Mon May  8 10:40:14 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * Fix all uses for Int that should be CInt or CSize in ffi imports.
  Spotted by Igloo, dcoutts

Mon May  8 16:09:41 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * Import nicer loop/loop fusion rule from ghc-ndp

Mon May  8 17:36:07 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * Fix stack leak in split on > 60M strings

Mon May  8 17:50:13 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * Try same fix for stack overflow in elemIndices

18 years agoFix all uses for Int that should be CInt or CSize in ffi imports. Spotted by Duncan...
Don Stewart [Mon, 8 May 2006 01:03:11 +0000 (01:03 +0000)]
Fix all uses for Int that should be CInt or CSize in ffi imports. Spotted by Duncan and Ian

18 years agoFixed import list syntax
Sven Panne [Sun, 7 May 2006 15:50:08 +0000 (15:50 +0000)]
Fixed import list syntax

18 years agoFaster filterF, filterNotByte
dons@cse.unsw.edu.au [Sun, 7 May 2006 04:23:01 +0000 (04:23 +0000)]
Faster filterF, filterNotByte

18 years agoMuch faster find, findIndex. Hint from sjanssen
dons@cse.unsw.edu.au [Sun, 7 May 2006 03:30:48 +0000 (03:30 +0000)]
Much faster find, findIndex. Hint from sjanssen

18 years agoMerge "unrecognized long opt" fix from 6.4.2
Sven Panne [Sat, 6 May 2006 11:05:19 +0000 (11:05 +0000)]
Merge "unrecognized long opt" fix from 6.4.2

18 years agoSat May 6 13:01:34 EST 2006 Don Stewart <dons@cse.unsw.edu.au>
dons@cse.unsw.edu.au [Sat, 6 May 2006 06:10:29 +0000 (06:10 +0000)]
Sat May  6 13:01:34 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * Do loopU realloc on the Haskell heap. And add a really tough stress test

Sat May  6 12:28:58 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * Use simple, 3x faster concat. Plus QC properties. Suggested by sjanssen and dcoutts

Sat May  6 15:59:31 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * dcoutt's packByte bug squashed

  With inlinePerformIO, ghc head was compiling:

   packByte 255 `compare` packByte 127

  into roughly

   case mallocByteString 2 of
       ForeignPtr f internals ->
            case writeWord8OffAddr# f 0 255 of _ ->
            case writeWord8OffAddr# f 0 127 of _ ->
            case eqAddr# f f of
                   False -> case compare (GHC.Prim.plusAddr# f 0)
                                         (GHC.Prim.plusAddr# f 0)

  which is rather stunning. unsafePerformIO seems to prevent whatever
  magic inlining was leading to this. Only affected the head.

18 years agoAdd array fusion versions of map, filter and foldl
dons@cse.unsw.edu.au [Fri, 5 May 2006 06:08:58 +0000 (06:08 +0000)]
Add array fusion versions of map, filter and foldl

This patch adds fusable map, filter and foldl, using the array fusion
code for unlifted, flat arrays, from the Data Parallel Haskell branch,
after kind help from Roman Leshchinskiy,

Pipelines of maps, filters and folds should now need to walk the
bytestring once only, and intermediate bytestrings won't be constructed.

18 years agofix for non-GHC
Ross Paterson [Thu, 4 May 2006 09:30:44 +0000 (09:30 +0000)]
fix for non-GHC

18 years agouse bracket in appendFile (like writeFile)
Ross Paterson [Thu, 4 May 2006 09:15:28 +0000 (09:15 +0000)]
use bracket in appendFile (like writeFile)

18 years agowriteFile: close the file on error
Simon Marlow [Thu, 4 May 2006 08:45:05 +0000 (08:45 +0000)]
writeFile: close the file on error
Suggested by Ross Paterson, via Neil Mitchell

18 years agoSync with FPS head
dons@cse.unsw.edu.au [Wed, 3 May 2006 10:52:59 +0000 (10:52 +0000)]
Sync with FPS head

This patch brings Data.ByteString into sync with the FPS head.
The most significant of which is the new Haskell counting sort.

Changes:

Sun Apr 30 18:16:29 EST 2006  sjanssen@cse.unl.edu
  * Fix foldr1 in Data.ByteString and Data.ByteString.Char8

Mon May  1 11:51:16 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
  * Add group and groupBy. Suggested by conversation between sjanssen and petekaz on #haskell

Mon May  1 16:42:04 EST 2006  sjanssen@cse.unl.edu
  * Fix groupBy to match Data.List.groupBy.

Wed May  3 15:01:07 EST 2006  sjanssen@cse.unl.edu
  * Migrate to counting sort.

  Data.ByteString.sort used C's qsort(), which is O(n log n).  The new algorithm
  is O(n), and is faster for strings larger than approximately thirty bytes.  We
  also reduce our dependency on cbits!

18 years agoimprove performance of Integer->String conversion
Simon Marlow [Wed, 3 May 2006 11:33:06 +0000 (11:33 +0000)]
improve performance of Integer->String conversion
See
 http://www.haskell.org//pipermail/libraries/2006-April/005227.html

Submitted by: bertram.felgenhauer@googlemail.com

18 years agoinline withMVar, modifyMVar, modifyMVar_
Simon Marlow [Wed, 3 May 2006 11:11:52 +0000 (11:11 +0000)]
inline withMVar, modifyMVar, modifyMVar_

18 years agoFix string truncating in hGetLine -- it was a pasto from Simon's code
Simon Marlow [Wed, 3 May 2006 10:35:04 +0000 (10:35 +0000)]
Fix string truncating in hGetLine -- it was a pasto from Simon's code
(from Don Stewart)

18 years agoMerge in Data.ByteString head. Fixes ByteString+cbits in hugs
Don Stewart [Sat, 29 Apr 2006 04:07:33 +0000 (04:07 +0000)]
Merge in Data.ByteString head. Fixes ByteString+cbits in hugs

18 years agoImport Data.ByteString from fps 0.5.
Don Stewart [Fri, 28 Apr 2006 13:07:18 +0000 (13:07 +0000)]
Import Data.ByteString from fps 0.5.
Fast, packed byte vectors, providing a better PackedString.

18 years agofix previous patch
Ross Paterson [Mon, 1 May 2006 15:48:47 +0000 (15:48 +0000)]
fix previous patch

18 years agofixes for non-GHC
Ross Paterson [Mon, 1 May 2006 14:43:22 +0000 (14:43 +0000)]
fixes for non-GHC

18 years agofix imports for mingw32 && !GHC
Ross Paterson [Thu, 27 Apr 2006 16:32:48 +0000 (16:32 +0000)]
fix imports for mingw32 && !GHC

18 years agoRequireOrder: do not collect unrecognised options after a non-opt
Simon Marlow [Wed, 26 Apr 2006 12:11:10 +0000 (12:11 +0000)]
RequireOrder: do not collect unrecognised options after a non-opt
The documentation for RequireOrder says "no option processing after
first non-option", so it doesn't seem right that we should process the
rest of the arguments to collect the unrecognised ones.  Presumably
the client wants to know about the unrecognised options up to the
first non-option, and will be using a different option parser for the
rest of the command line.

eg. before:

Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
([],["bar","--foo"],["--foo"],[])

after:

Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
([],["bar","--foo"],[],[])

18 years agofix for Haddock 0.7
Ashley Yakeley [Wed, 26 Apr 2006 07:25:21 +0000 (07:25 +0000)]
fix for Haddock 0.7

18 years agoadd Data.Fixed module
Ashley Yakeley [Tue, 25 Apr 2006 07:18:53 +0000 (07:18 +0000)]
add Data.Fixed module

18 years agoadd instances
Ross Paterson [Mon, 24 Apr 2006 10:21:46 +0000 (10:21 +0000)]
add instances

18 years agoadd superclasses to Applicative and Traversable
Ross Paterson [Tue, 11 Apr 2006 14:47:34 +0000 (14:47 +0000)]
add superclasses to Applicative and Traversable

Functor is now a superclass of Applicative, and Functor and Foldable
are now superclasses of Traversable.  The new hierarchy makes clear the
inclusions between the classes, but means more work in defining instances.
Default definitions are provided to help.

18 years agoadd Functor and Monad instances for Prelude types
Ross Paterson [Mon, 10 Apr 2006 11:14:43 +0000 (11:14 +0000)]
add Functor and Monad instances for Prelude types

18 years agoGHC.Base.breakpoint
Lemmih [Fri, 7 Apr 2006 12:58:27 +0000 (12:58 +0000)]
GHC.Base.breakpoint

18 years agoTrack the GHC source tree reorganisation
Simon Marlow [Fri, 7 Apr 2006 04:16:31 +0000 (04:16 +0000)]
Track the GHC source tree reorganisation

18 years agoin the show instance for Exception, print the type of dynamic exceptions
Simon Marlow [Thu, 6 Apr 2006 11:24:44 +0000 (11:24 +0000)]
in the show instance for Exception, print the type of dynamic exceptions
Unfortunately this requires some recursve module hackery to get at
the show instance for Typeable.

18 years agoimplement ForeignEnvPtr, newForeignPtrEnv, addForeignPtrEnv for GHC
Simon Marlow [Wed, 5 Apr 2006 15:54:48 +0000 (15:54 +0000)]
implement ForeignEnvPtr, newForeignPtrEnv, addForeignPtrEnv for GHC

18 years agoadd forkOnIO :: Int -> IO () -> IO ThreadId
Simon Marlow [Mon, 27 Mar 2006 13:50:18 +0000 (13:50 +0000)]
add  forkOnIO :: Int -> IO () -> IO ThreadId

18 years agoRework previous: not a gcc bug after all
Simon Marlow [Thu, 23 Mar 2006 16:12:29 +0000 (16:12 +0000)]
Rework previous: not a gcc bug after all
It turns out that we were relying on behaviour that is undefined in C,
and undefined behaviour in C means "the compiler can do whatever the
hell it likes with your entire program".  So avoid that.

18 years agowork around a gcc 4.1.0 codegen bug in -O2 by forcing -O1 for GHC.Show
Simon Marlow [Thu, 23 Mar 2006 13:45:14 +0000 (13:45 +0000)]
work around a gcc 4.1.0 codegen bug in -O2 by forcing -O1 for GHC.Show
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26824

18 years agocommit mysteriously missing parts of "runIOFastExit" patch
Simon Marlow [Tue, 21 Mar 2006 10:15:35 +0000 (10:15 +0000)]
commit mysteriously missing parts of "runIOFastExit" patch

18 years agoadd runIOFastExit :: IO a -> IO a
Simon Marlow [Mon, 20 Mar 2006 12:43:33 +0000 (12:43 +0000)]
add runIOFastExit :: IO a -> IO a
Similar to runIO, but calls stg_exit() directly to exit, rather than
shutdownHaskellAndExit().  Needed for running GHCi in the test suite.

18 years agoFix a broken invariant
Simon Marlow [Thu, 16 Mar 2006 13:41:51 +0000 (13:41 +0000)]
Fix a broken invariant
Patch from #694,  for the problem "empty is an identity for <> and $$" is
currently broken by eg. isEmpty (empty<>empty)"

18 years agoAdd unsafeSTToIO :: ST s a -> IO a
Simon Marlow [Wed, 15 Mar 2006 16:02:32 +0000 (16:02 +0000)]
Add unsafeSTToIO :: ST s a -> IO a
Implementation for Hugs is missing, but should be easy.  We need this
for the forthcoming nested data parallelism implementation.

18 years agoAdded 'alter'
jeanphilippe.bernardy@gmail.com [Wed, 15 Mar 2006 14:35:39 +0000 (14:35 +0000)]
Added 'alter'
Added 'alter :: (Maybe a -> Maybe a) -> k -> Map k a -> Map k a' to IntMap and Map
This addresses ticket #665

18 years agodeprecate FunctorM in favour of Foldable and Traversable
Ross Paterson [Wed, 15 Mar 2006 09:29:42 +0000 (09:29 +0000)]
deprecate FunctorM in favour of Foldable and Traversable
as discussed on the libraries list.

18 years agoSimplify Eq, Ord, and Show instances for UArray
Simon Marlow [Mon, 13 Mar 2006 14:27:01 +0000 (14:27 +0000)]
Simplify Eq, Ord, and Show instances for UArray
The Eq, Ord, and Show instances of UArray were written out longhand
with one instance per element type.  It is possible to condense these
into a single instance for each class, at the expense of using more
extensions (non-std context on instance declaration).

Suggestion by: Frederik Eaton <frederik@ofb.net>

18 years agoOops typo in intSet notMember
jeanphilippe.bernardy@gmail.com [Sat, 11 Mar 2006 22:47:13 +0000 (22:47 +0000)]
Oops typo in intSet notMember

18 years agoIntMap lookup now returns monad instead of Maybe.
jeanphilippe.bernardy@gmail.com [Sat, 11 Mar 2006 22:45:02 +0000 (22:45 +0000)]
IntMap lookup now returns monad instead of Maybe.

18 years agoAdded notMember to Data.IntSet and Data.IntMap
jeanphilippe.bernardy@gmail.com [Sat, 11 Mar 2006 08:52:21 +0000 (08:52 +0000)]
Added notMember to Data.IntSet and Data.IntMap

18 years agoadd Data.Set.notMember and Data.Map.notMember
John Meacham [Thu, 9 Mar 2006 19:18:06 +0000 (19:18 +0000)]
add Data.Set.notMember and Data.Map.notMember

18 years agoaddToClockTime: handle picoseconds properly
Simon Marlow [Fri, 10 Mar 2006 11:45:32 +0000 (11:45 +0000)]
addToClockTime: handle picoseconds properly
fixes #588

18 years agomake head/build rule apply to all types, not just Bool.
John Meacham [Fri, 3 Mar 2006 04:57:53 +0000 (04:57 +0000)]
make head/build rule apply to all types, not just Bool.

18 years agoAvoid overflow when normalising clock times
Ian Lynagh [Fri, 10 Feb 2006 14:46:38 +0000 (14:46 +0000)]
Avoid overflow when normalising clock times

18 years agoYears have 365 days, not 30*365
Ian Lynagh [Fri, 10 Feb 2006 14:28:53 +0000 (14:28 +0000)]
Years have 365 days, not 30*365

18 years agodeclare blkcmp() static
Simon Marlow [Thu, 23 Feb 2006 13:43:17 +0000 (13:43 +0000)]
declare blkcmp() static

18 years agotypo in comment in Foldable class
Ross Paterson [Thu, 9 Feb 2006 00:49:01 +0000 (00:49 +0000)]
typo in comment in Foldable class

18 years agosimplify fmap
Ross Paterson [Mon, 6 Feb 2006 09:50:48 +0000 (09:50 +0000)]
simplify fmap

18 years agoupdate ref in comment
Ross Paterson [Mon, 6 Feb 2006 09:51:39 +0000 (09:51 +0000)]
update ref in comment

18 years agoGive -foverlapping-instances to Data.Typeable
simonpj@microsoft [Mon, 6 Feb 2006 13:34:39 +0000 (13:34 +0000)]
Give -foverlapping-instances to Data.Typeable

For some time, GHC has made -fallow-overlapping-instances "sticky":
any instance in a module compiled with -fallow-overlapping-instances
can overlap when imported, regardless of whether the importing module
allows overlap.  (If there is an overlap, both instances must come from
modules thus compiled.)

Instances in Data.Typeable might well want to be overlapped, so this
commit adds the flag to Data.Typeable (with an explanatory comment)

18 years agoAdd -fno-bang-patterns to modules using both bang and glasgow-exts
simonpj@microsoft.com [Fri, 3 Feb 2006 17:57:59 +0000 (17:57 +0000)]
Add -fno-bang-patterns to modules using both bang and glasgow-exts

18 years agoWhen splitting a bucket, keep the contents in the same order
Simon Marlow [Wed, 1 Feb 2006 13:04:27 +0000 (13:04 +0000)]
When splitting a bucket, keep the contents in the same order
To retain the property that multiple inserts shadow each other
(see ticket #661, test hash001)

18 years agoadd foldr/build optimisation for take and replicate
Simon Marlow [Thu, 26 Jan 2006 16:46:03 +0000 (16:46 +0000)]
add foldr/build optimisation for take and replicate
This allows take to be deforested, and improves performance of
replicate and replicateM/replicateM_.  We have a separate problem that
means expressions involving [n..m] aren't being completely optimised
because eftIntFB isn't being inlined but otherwise the results look
good.

Sadly this has invalidated a number of the nofib benchmarks which were
erroneously using take to duplicate work in a misguided attempt to
lengthen their runtimes (ToDo).

18 years agoGenerate PrimopWrappers.hs with Haddock docs
Simon Marlow [Tue, 24 Jan 2006 13:11:21 +0000 (13:11 +0000)]
Generate PrimopWrappers.hs with Haddock docs
Patch originally from Dinko Tenev <dinko.tenev@gmail.com>, modified
to add log message by me.

18 years ago[project @ 2006-01-19 14:47:15 by ross]
ross [Thu, 19 Jan 2006 14:47:15 +0000 (14:47 +0000)]
[project @ 2006-01-19 14:47:15 by ross]
backport warning avoidance from Haddock

18 years ago[project @ 2006-01-18 11:45:47 by malcolm]
malcolm [Wed, 18 Jan 2006 11:45:47 +0000 (11:45 +0000)]
[project @ 2006-01-18 11:45:47 by malcolm]
Fix import of Ix for nhc98.