This project is mirrored from Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 10 Jan, 2017 1 commit
  2. 17 Sep, 2013 2 commits
  3. 06 Jun, 2013 1 commit
    • Simon Peyton Jones's avatar
      Re-jig SOURCE imports · 8d87b5bf
      Simon Peyton Jones authored
      * Do not have have an hs-boot file for Data.Typeable
      * Instead make all the loops go through
           GHC.Err (just a couple of magic functions)
           GHC.Exception (some non-exceptional functions)
      The main idea is
        a) don't involve classes in the hs-boot world
        b) loop through error cases where performance doesn't matter
        c) be careful not to SOURCE import things that are bottom,
           unless MkCore knows about them in eRROR_IDS, so that we
           see their strictness
  4. 15 Feb, 2013 1 commit
  5. 26 Oct, 2011 1 commit
  6. 25 Oct, 2011 1 commit
  7. 18 Jun, 2011 1 commit
  8. 28 Jan, 2011 1 commit
  9. 14 Jul, 2010 1 commit
  10. 30 Nov, 2009 1 commit
  11. 06 Jul, 2009 1 commit
  12. 12 Jun, 2009 1 commit
    • Simon Marlow's avatar
      Rewrite of the IO library, including Unicode support · 7b067f2d
      Simon Marlow authored
      * Unicode support for Handle I/O:
        ** Automatic encoding and decoding using a per-Handle encoding.
        ** The encoding defaults to the locale encoding (only on Unix 
           so far, perhaps Windows later).
        ** Built-in UTF-8, UTF-16 (BE/LE), and UTF-32 (BE/LE) codecs.
        ** iconv-based codec for other encodings on Unix
      * Modularity: the low-level IO interface is exposed as a type class
        (GHC.IO.IODevice) so you can build your own low-level IO providers and
        make Handles from them.
      * Newline translation: instead of being Windows-specific wired-in
        magic, the translation from \r\n -> \n and back again is available
        on all platforms and is configurable for reading/writing
      Unicode-aware Handles
      This is a significant restructuring of the Handle implementation with
      the primary goal of supporting Unicode character encodings.
      The only change to the existing behaviour is that by default, text IO
      is done in the prevailing locale encoding of the system (except on
      Windows [1]).  
      Handles created by openBinaryFile use the Latin-1 encoding, as do
      Handles placed in binary mode using hSetBinaryMode.
      We provide a way to change the encoding for an existing Handle:
         GHC.IO.Handle.hSetEncoding :: Handle -> TextEncoding -> IO ()
      and various encodings (from GHC.IO.Encoding):
         utf16, utf16le, utf16be,
         utf32, utf32le, utf32be,
      and a way to lookup other encodings:
         GHC.IO.Encoding.mkTextEncoding :: String -> IO TextEncoding
      (it's system-dependent whether the requested encoding will be
      We may want to export these from somewhere more permanent; that's a
      topic for a future library proposal.
      Thanks to suggestions from Duncan Coutts, it's possible to call
      hSetEncoding even on buffered read Handles, and the right thing
      happens.  So we can read from text streams that include multiple
      encodings, such as an HTTP response or email message, without having
      to turn buffering off (though there is a penalty for switching
      encodings on a buffered Handle, as the IO system has to do some
      re-decoding to figure out where it should start reading from again).
      If there is a decoding error, it is reported when an attempt is made
      to read the offending character from the Handle, as you would expect.
      Performance varies.  For "hGetContents >>= putStr" I found the new
      library was faster on my x86_64 machine, but slower on an x86.  On the
      whole I'd expect things to be a bit slower due to the extra
      decoding/encoding, but probabaly not noticeably.  If performance is
      critical for your app, then you should be using bytestring and text
      [1] Note: locale encoding is not currently implemented on Windows due
      to the built-in Win32 APIs for encoding/decoding not being sufficient
      for our purposes.  Ask me for details.  Offers of help gratefully
      Newline Translation
      In the old IO library, text-mode Handles on Windows had automatic
      translation from \r\n -> \n on input, and the opposite on output.  It
      was implemented using the underlying CRT functions, which meant that
      there were certain odd restrictions, such as read/write text handles
      needing to be unbuffered, and seeking not working at all on text
      In the rewrite, newline translation is now implemented in the upper
      layers, as it needs to be since we have to perform Unicode decoding
      before newline translation.  This means that it is now available on
      all platforms, which can be quite handy for writing portable code.
      For now, I have left the behaviour as it was, namely \r\n -> \n on
      Windows, and no translation on Unix.  However, another reasonable
      default (similar to what Python does) would be to do \r\n -> \n on
      input, and convert to the platform-native representation (either \r\n
      or \n) on output.  This is called universalNewlineMode (below).
      The API is as follows.  (available from GHC.IO.Handle for now, again
      this is something we will probably want to try to get into System.IO
      at some point):
      -- | The representation of a newline in the external file or stream.
      data Newline = LF    -- ^ "\n"
                   | CRLF  -- ^ "\r\n"
                   deriving Eq
      -- | Specifies the translation, if any, of newline characters between
      -- internal Strings and the external file or stream.  Haskell Strings
      -- are assumed to represent newlines with the '\n' character; the
      -- newline mode specifies how to translate '\n' on output, and what to
      -- translate into '\n' on input.
      data NewlineMode 
        = NewlineMode { inputNL :: Newline,
                          -- ^ the representation of newlines on input
                        outputNL :: Newline
                          -- ^ the representation of newlines on output
                   deriving Eq
      -- | The native newline representation for the current platform
      nativeNewline :: Newline
      -- | Map "\r\n" into "\n" on input, and "\n" to the native newline
      -- represetnation on output.  This mode can be used on any platform, and
      -- works with text files using any newline convention.  The downside is
      -- that @readFile a >>= writeFile b@ might yield a different file.
      universalNewlineMode :: NewlineMode
      universalNewlineMode  = NewlineMode { inputNL  = CRLF, 
                                            outputNL = nativeNewline }
      -- | Use the native newline representation on both input and output
      nativeNewlineMode    :: NewlineMode
      nativeNewlineMode     = NewlineMode { inputNL  = nativeNewline, 
                                            outputNL = nativeNewline }
      -- | Do no newline translation at all.
      noNewlineTranslation :: NewlineMode
      noNewlineTranslation  = NewlineMode { inputNL  = LF, outputNL = LF }
      -- | Change the newline translation mode on the Handle.
      hSetNewlineMode :: Handle -> NewlineMode -> IO ()
      IO Devices
      The major change here is that the implementation of the Handle
      operations is separated from the underlying IO device, using type
      classes.  File descriptors are just one IO provider; I have also
      implemented memory-mapped files (good for random-access read/write)
      and a Handle that pipes output to a Chan (useful for testing code that
      writes to a Handle).  New kinds of Handle can be implemented outside
      the base package, for instance someone could write bytestringToHandle.
      A Handle is made using mkFileHandle:
      -- | makes a new 'Handle'
      mkFileHandle :: (IODevice dev, BufferedIO dev, Typeable dev)
                    => dev -- ^ the underlying IO device, which must support
                           -- 'IODevice', 'BufferedIO' and 'Typeable'
                    -> FilePath
                           -- ^ a string describing the 'Handle', e.g. the file
                           -- path for a file.  Used in error messages.
                    -> IOMode
                           -- ^ The mode in which the 'Handle' is to be used
                    -> Maybe TextEncoding
                           -- ^ text encoding to use, if any
                    -> NewlineMode
                           -- ^ newline translation mode
                    -> IO Handle
      This also means that someone can write a completely new IO
      implementation on Windows based on native Win32 HANDLEs, and
      distribute it as a separate package (I really hope somebody does
      This restructuring isn't as radical as previous designs.  I haven't
      made any attempt to make a separate binary I/O layer, for example
      (although hGetBuf/hPutBuf do bypass the text encoding and newline
      translation).  The main goal here was to get Unicode support in, and
      to allow others to experiment with making new kinds of Handle.  We
      could split up the layers further later.
      API changes and Module structure
      NB. GHC.IOBase and GHC.Handle are now DEPRECATED (they are still
      present, but are just re-exporting things from other modules now).
      For 6.12 we'll want to bump base to version 5 and add a base4-compat.
      For now I'm using #if __GLASGOW_HASKEL__ >= 611 to avoid deprecated
      I split modules into smaller parts in many places.  For example, we
      now have GHC.IORef, GHC.MVar and GHC.IOArray containing the
      implementations of IORef, MVar and IOArray respectively.  This was
      necessary for untangling dependencies, but it also makes things easier
      to follow.
      The new module structurue for the IO-relatied parts of the base
      package is:
         Implementation of the IO monad; unsafe*; throw/catch
         The IOMode type
         Buffers and operations on them
         The IODevice and RawIO classes.
         The BufferedIO class.
         The FD type, with instances of IODevice, RawIO and BufferedIO.
         IO-related Exceptions
         The TextEncoding type; built-in TextEncodings; mkTextEncoding
         Implementation internals for GHC.IO.Encoding
         The main API for GHC's Handle implementation, provides all the Handle
         operations + mkFileHandle + hSetEncoding.
         Implementation of Handles and operations.
         Parts of the Handle API implemented by file-descriptors: openFile,
         stdin, stdout, stderr, fdToHandle etc.
  13. 10 Dec, 2008 1 commit
  14. 16 Jun, 2008 1 commit
  15. 19 Feb, 2008 1 commit
  16. 16 May, 2007 1 commit
  17. 05 Apr, 2006 1 commit
  18. 02 Feb, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-02-02 13:26:13 by simonpj] · 771e82b2
      simonpj authored
      I've moved Typeable instances so that they are
      either in the module that defines the type
      or in the Typeable module (which defines the class)
      GHC dislikes "orphan" instances, and even for humans
      this makes it easier to find.
      I have continued to use the INSTANCE_TYPEABLE macros,
      rather than GHC's deriving( Typeable ) mechanism, so
      that it'll still work for Hugs and NHC.  Nevertheless,
      I may well have missed some Hugs- or NHC-specific imports,
      for which I apologise.  Malcolm, Ross you may want to try
      a fresh build.
  19. 11 Jan, 2005 1 commit
  20. 23 Dec, 2004 1 commit
    • ralf's avatar
      [project @ 2004-12-23 00:02:41 by ralf] · 097b2438
      ralf authored
      Resolved stage1 issues related SPJ's
      commit "Add more scoped type variables".
      Incidentally, this provides some input for
      the recent GHC list discussion on whether
      to provide lex. scope for function signatures.
      Not too many modules are affected! Good!
      The example hslibs/data/edison/Seq/BinaryRandList.hs
      was interesting in so far that indeed up-front
      function signatures were given in one shot, so
      one is really a bit confused to see type variables
      in where clauses to clash with far-removed top-level
      function signatures.
  21. 08 Sep, 2004 1 commit
  22. 25 Feb, 2004 1 commit
  23. 05 Nov, 2003 1 commit
  24. 04 Nov, 2003 1 commit
  25. 01 Aug, 2003 1 commit
    • ross's avatar
      [project @ 2003-08-01 10:00:48 by ross] · 4aa9bf58
      ross authored
      Swapped argument order of `newForeignPtr' and `addForeignPtrFinalizer'
      to track FFI spec.  (Maybe the Conc ones should do the same?)
      This will break NHC.
  26. 29 Jul, 2003 1 commit
  27. 24 Jul, 2003 1 commit
    • ralf's avatar
      [project @ 2003-07-24 12:19:57 by ralf] · 88738f0e
      ralf authored
      Major refactoring of Data/Generics.
      This also affects the compiler (because of deriving issues).
      This is an intermediate commit.
      The library is supposed to compile fine.
      But the deriving stuff for Data needs to be revised.
      The testsuite for Data/Generics will not pass.
      gread is broken at the moment.
      So it is strongly recommended not to cvs upd for a few hours or a day.
      Detailed description of changes:
      - Split up Data/Dynamic into Data/Typeable and Data/Dynamic.
        (This makes clear what part is about TypeReps and cast vs.
         dynamics. The latter is not needed by Data/Generics.)
      - Renamed Data/include/Dynamic.h -> Typeable.h to end confusion.
      - Split up Data/Generics.hs in a set of modules.
      - Revised class Data:
        - Got rid of gunfold but added fromConstr as more primtive one
        - Revised representations of constructors
        - Revised treatment of primitive types
      - Revised type of gmapQ; preserved old gmapQ as gmapL
      - Added a module Data/Types.hs for treatment of types as values.
      This is going somewhere.
  28. 12 Jun, 2003 5 commits
  29. 27 May, 2003 1 commit
  30. 22 May, 2003 1 commit
    • chak's avatar
      [project @ 2003-05-22 08:24:32 by chak] · 69c5373c
      chak authored
      Added a `FinalizerPtr' synonym as in the FFI Addendum (RC 10).
      ** ATTENTION **
      This will break the "#ifdef __NHC__" and "#ifdef __HUGS__" variants of
      `ForeignPtr'.  See `GHC/ForeignPtr.hs' for the definitions.
  31. 30 Mar, 2003 1 commit
  32. 27 Mar, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-03-27 10:24:43 by simonmar] · b5a75c96
      simonmar authored
      [ oops, forgot to commit this with the rest of the changes yesterday... ]
      Change our ForeignPtr implementation to match the spec: finalizers
      must now be foreign functions.
      Move the old Haskell-finalizer versions of newForeignPtr and
      addForeignPtrFinalizer into Foreign.Concurrent, to make it clear that
      the implementations of these functions require concurrency.
      While I'm here: move the GHC-specific parts of the ForeignPtr
      implementation into GHC.ForeignPtr.
  33. 23 Jan, 2003 1 commit
  34. 22 Jan, 2003 1 commit
  35. 12 Dec, 2002 1 commit