1. 18 May, 2006 6 commits
  2. 17 May, 2006 2 commits
  3. 13 May, 2006 1 commit
  4. 12 May, 2006 1 commit
  5. 10 May, 2006 2 commits
    • Don Stewart's avatar
      Some small optimisations, generalise the type of unfold · 26e52f4c
      Don Stewart authored
          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
      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
    • Ross Paterson's avatar
      portable implementation of WordPtr/IntPtr for non-GHC · 90b16784
      Ross Paterson authored
      plus much tweaking of imports to avoid cycles
  6. 09 May, 2006 4 commits
  7. 08 May, 2006 5 commits
    • simonpj@microsoft's avatar
      Make length a good consumer · 2f3d49f3
      simonpj@microsoft authored
      Make length into a good consumer.  Fixes Trac bug #707.
      (Before length simply didn't use foldr.)
    • simonpj@microsoft's avatar
      Trim imports · 5643470d
      simonpj@microsoft authored
    • simonpj@microsoft's avatar
      Make unsafePerformIO lazy · e23efcff
      simonpj@microsoft authored
      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
      Solving this by making all NOINLINE things have no strictness info is overkill.
      In particular, it's overkill for runST, which is perfectly respectable.
      	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.
    • Don Stewart's avatar
      Sync with FPS head. · aea8eebd
      Don Stewart authored
      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
    • Don Stewart's avatar
  8. 07 May, 2006 3 commits
  9. 06 May, 2006 2 commits
    • sven.panne@aedion.de's avatar
    • dons@cse.unsw.edu.au's avatar
      · 916d10f8
      dons@cse.unsw.edu.au authored
      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.
  10. 05 May, 2006 1 commit
    • dons@cse.unsw.edu.au's avatar
      Add array fusion versions of map, filter and foldl · 5dc6d8aa
      dons@cse.unsw.edu.au authored
      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.
  11. 04 May, 2006 3 commits
  12. 03 May, 2006 4 commits
  13. 29 Apr, 2006 1 commit
  14. 28 Apr, 2006 1 commit
  15. 01 May, 2006 2 commits
  16. 27 Apr, 2006 1 commit
  17. 26 Apr, 2006 1 commit
    • Simon Marlow's avatar
      RequireOrder: do not collect unrecognised options after a non-opt · 7ebcbea3
      Simon Marlow authored
      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"]
      Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]