summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/IO
Commit message (Collapse)AuthorAgeFilesLines
* Add Javascript backendSylvain Henry2022-11-293-2/+43
| | | | | | | | | | | | | | | Add JS backend adapted from the GHCJS project by Luite Stegeman. Some features haven't been ported or implemented yet. Tests for these features have been disabled with an associated gitlab ticket. Bump array submodule Work funded by IOG. Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io> Co-authored-by: Luite Stegeman <stegeman@gmail.com> Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
* winio: do not re-translate input when handle is uncookedTamar Christina2022-10-121-22/+32
|
* Add a Note summarising GHC's UTF-8 implementationsBen Gamari2022-07-221-0/+4
| | | | | GHC has a somewhat dizzying array of UTF-8 implementations. This note describes why this is the case.
* typosEric Lindblad2022-07-185-5/+5
|
* winio: make consoleReadNonBlocking not wait for any events at all.Tamar Christina2022-07-071-9/+30
|
* winio: Add support to console handles to handleToHANDLETamar Christina2022-06-181-3/+5
|
* Expand documentation of hIsTerminalDeviceBodigrim2022-05-281-1/+8
|
* base: Throw exceptions raised while closing finalized HandlesBen Gamari2022-05-191-2/+32
| | | | Fixes #21336.
* Documentation for setLocaleEncodingBodigrim2022-04-271-2/+27
|
* Improve error messages from GHC.IO.Encoding.FailureBodigrim2022-04-221-8/+12
|
* Suggestions due to hlintMatthew Pickering2022-02-241-1/+1
| | | | | It turns out this job hasn't been running for quite a while (perhaps ever) so there are quite a few failures when running the linter locally.
* Fix a few Note inconsistenciesBen Gamari2022-02-016-8/+8
|
* winio: fix heap corruption and various leaks.Tamar Christina2022-01-151-1/+1
|
* Perf: remove allocation in writeBlocks and fix comment (#14309)Sylvain Henry2021-12-111-32/+39
|
* Revert "Data.List specialization to []"Matthew Pickering2021-12-032-2/+2
| | | | | | | | | | This reverts commit bddecda1a4c96da21e3f5211743ce5e4c78793a2. This implements the first step in the plan formulated in #20025 to improve the communication and migration strategy for the proposed changes to Data.List. Requires changing the haddock submodule to update the test output.
* Make openFile more tolerant of async excs (#18832)Kamil Dworakowski2021-12-021-45/+14
|
* Insert warnings in the documentation of dangerous functionsTom Sydney Kerckhove2021-10-151-0/+4
|
* docs: Clarify documentation of `getFileSystemEncoding` (#20344)Zubin Duggal2021-10-051-1/+3
| | | | It may not always be a Unicode encoding
* winio: use synchronous access explicitly for handles that may not be ↵Tamar Christina2021-06-082-17/+35
| | | | asynchronous.
* Data.List specialization to []Oleg Grenrus2021-04-012-2/+2
| | | | | | | - Remove GHC.OldList - Remove Data.OldList - compat-unqualified-imports is no-op - update haddock submodule
* Add compiler linting to CIHécate2021-03-251-1/+0
| | | | | This commit adds the `lint:compiler` Hadrian target to the CI runner. It does also fixes hints in the compiler/ and libraries/base/ codebases.
* base: Add reference to #19413 to Note [unsafePerformIO and strictness]Ben Gamari2021-03-041-1/+1
|
* Fix array and cleanup conversion primops (#19026)Sylvain Henry2021-03-034-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first change makes the array ones use the proper fixed-size types, which also means that just like before, they can be used without explicit conversions with the boxed sized types. (Before, it was Int# / Word# on both sides, now it is fixed sized on both sides). For the second change, don't use "extend" or "narrow" in some of the user-facing primops names for conversions. - Names like `narrowInt32#` are misleading when `Int` is 32-bits. - Names like `extendInt64#` are flat-out wrong when `Int is 32-bits. - `narrow{Int,Word}<N>#` however map a type to itself, and so don't suffer from this problem. They are left as-is. These changes are batched together because Alex happend to use the array ops. We can only use released versions of Alex at this time, sadly, and I don't want to have to have a release thatwon't work for the final GHC 9.2. So by combining these we get all the changes for Alex done at once. Bump hackage state in a few places, and also make that workflow slightly easier for the future. Bump minimum Alex version Bump Cabal, array, bytestring, containers, text, and binary submodules
* Make openFile exception safeDavid Feuer2021-02-225-100/+355
| | | | | | | | | | | | | | | | | | | * `openFile` could sometimes leak file descriptors if it received an asynchronous exception (#19114, #19115). Fix this on POSIX. * `openFile` and more importantly `openFileBlocking` could not be interrupted effectively during the `open` system call (#17912). Fix this on POSIX. * Implement `readFile'` using `withFile` to ensure the file is closed promptly on exception. * Avoid `bracket` in `withFile`, reducing the duration of masking. Closes #19130. Addresses #17912, #19114, and #19115 on POSIX systems, but not on Windows.
* base: Use unsafeWithForeignPtr in GHC.IO.BufferBen Gamari2021-02-141-5/+6
|
* Fix typosBrian Wignall2021-02-062-2/+2
|
* Make unsafeDupablePerformIO have a lazy demandAndreas Klebinger2021-02-061-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | When a user writes code like: unsafePerformIO $ do let x = f x writeIORef ref x return x We might expect that the write happens before we evaluate `f x`. Sadly this wasn't to case for reasons detailed in #19181. We fix this by avoiding the strict demand by turning: unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> a into unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> lazy a This makes the above code lazy in x. And ensures the side effect of the write happens before the evaluation of `f x`. If a user *wants* the code to be strict on the returned value he can simply use `return $! x`. This fixes #19181
* Import fcntl with capi calling conventionOleg Grenrus2021-01-171-0/+1
| | | | See https://gitlab.haskell.org/ghc/ghc/-/issues/18854
* Fix calls to varargs C function fcntlNick Erdmann2021-01-091-1/+2
| | | | | | The ccall calling convention doesn't support varargs functions, so switch to capi instead. See https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html#varargs-not-supported-by-ccall-calling-convention
* [Sized Cmm] properly retain sizes.Moritz Angermann2020-11-264-27/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces all Word<N> = W<N># Word# and Int<N> = I<N># Int# with Word<N> = W<N># Word<N># and Int<N> = I<N># Int<N>#, thus providing us with properly sized primitives in the codegenerator instead of pretending they are all full machine words. This came up when implementing darwinpcs for arm64. The darwinpcs reqires us to pack function argugments in excess of registers on the stack. While most procedure call standards (pcs) assume arguments are just passed in 8 byte slots; and thus the caller does not know the exact signature to make the call, darwinpcs requires us to adhere to the prototype, and thus have the correct sizes. If we specify CInt in the FFI call, it should correspond to the C int, and not just be Word sized, when it's only half the size. This does change the expected output of T16402 but the new result is no less correct as it eliminates the narrowing (instead of the `and` as was previously done). Bumps the array, bytestring, text, and binary submodules. Co-Authored-By: Ben Gamari <ben@well-typed.com> Metric Increase: T13701 T14697
* base: Reintroduce necessary LANGUAGE pragmasBen Gamari2020-10-161-0/+2
| | | | These were incorrectly removed in a recent cleanup commit.
* winio: fixed more data error.Tamar Christina2020-10-091-1/+1
|
* winio: fixed bytestring reading interface.Tamar Christina2020-10-091-3/+8
|
* Add linting of `base` to the CIHécate2020-10-092-3/+1
|
* Update Lock.hs with more documentation to make sure that the Boolean return ↵syd@cs-syd.eu2020-09-241-0/+2
| | | | | | value is clear. [skip ci]
* Remove redundant "do", "return" and language extensions from baseHécate2020-09-237-97/+90
|
* Re-add BangPatterns to CodePage.hsHécate2020-08-131-0/+2
|
* Remove all the unnecessary LANGUAGE pragmasHécate2020-08-053-5/+4
|
* winio: clarify comment on cooked mode.Tamar Christina2020-07-151-1/+2
|
* winio: fix initial linux validate buildAndreas Klebinger2020-07-151-1/+3
|
* winio: flushCharReadBuffer shouldn't need to adjust offsets.Andreas Klebinger2020-07-151-5/+8
|
* winio: Remove historical todosAndreas Klebinger2020-07-151-3/+0
|
* winio: add comment stating failure behaviour for getUniqueFileInfo.Andreas Klebinger2020-07-151-0/+4
|
* winio: Rename SmartHandles to StdHandlesAndreas Klebinger2020-07-153-5/+5
|
* winio: Remove redundant buffer write in Handle/Text.hs:bufReadEmptyAndreas Klebinger2020-07-151-2/+1
|
* winio: Remove commented out pragmaAndreas Klebinger2020-07-151-1/+0
|
* winio: add a note about file locking in the RTS.Andreas Klebinger2020-07-152-0/+2
|
* winio: Don't mention windows specific functions when building on Linux.Andreas Klebinger2020-07-151-2/+23
|
* winio: fix -werror issue in encoding fileTamar Christina2020-07-151-2/+2
|
* winio: Deduplicate openFile logicAndreas Klebinger2020-07-151-78/+46
|