Skip to content

Commit

Permalink
Move Utils modules into the System.FS hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisdral committed May 3, 2024
1 parent 6c5752e commit cec149c
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 2 additions & 0 deletions fs-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Remove orphan `Show` instance for `Foreign.C.Error.Errno`.
* Provide implementations for the new primitives in the `IO` implementation of
`HasFS`. As a result, `ioHasFS` now requires that `PrimState IO ~ PrimState m`.
* Rename `Util.CallStack` and `Util.Condense` to `System.FS.CallStack` and
`System.FS.Condense` respectively.

### Non-breaking

Expand Down
4 changes: 2 additions & 2 deletions fs-api/fs-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ library
System.FS.API.Lazy
System.FS.API.Strict
System.FS.API.Types
System.FS.CallStack
System.FS.Condense
System.FS.CRC
System.FS.IO
System.FS.IO.Internal
System.FS.IO.Internal.Handle
Util.CallStack
Util.Condense

default-language: Haskell2010
build-depends:
Expand Down
3 changes: 1 addition & 2 deletions fs-api/src/System/FS/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ import Data.Word
import System.Posix.Types (ByteCount)

import System.FS.API.Types as Types

import Util.CallStack
import System.FS.CallStack

{------------------------------------------------------------------------------
Record that abstracts over the filesystem
Expand Down
2 changes: 1 addition & 1 deletion fs-api/src/System/FS/API/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Data.ByteString.Lazy as BL
import Data.Word (Word64)
import System.FS.API as API
import System.FS.API.Strict
import Util.CallStack (HasCallStack, prettyCallStack)
import System.FS.CallStack (HasCallStack, prettyCallStack)

-- | Makes sure it reads all requested bytes.
-- If eof is found before all bytes are read, it throws an exception.
Expand Down
2 changes: 1 addition & 1 deletion fs-api/src/System/FS/API/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module System.FS.API.Strict (
import qualified Data.ByteString as BS
import Data.Word
import System.FS.API as API
import Util.CallStack
import System.FS.CallStack

-- | This function makes sure that the whole 'BS.ByteString' is written.
hPutAllStrict :: forall m h
Expand Down
4 changes: 2 additions & 2 deletions fs-api/src/System/FS/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ import System.FilePath
import System.IO (SeekMode (..))
import qualified System.IO.Error as IO

import Util.CallStack
import Util.Condense
import System.FS.CallStack
import System.FS.Condense

{-------------------------------------------------------------------------------
Modes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- | CallStack with a nicer 'Show' instance
--
-- Use of this module is intended to /replace/ import of @GHC.Stack@
module Util.CallStack (
module System.FS.CallStack (
prettyCallStack
-- * opaque
, PrettyCallStack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{-# LANGUAGE UndecidableInstances #-}

-- | Condensed but human-readable output (like 'Show').
module Util.Condense (
module System.FS.Condense (
Condense (..)
, Condense1 (..)
, condense1
Expand Down
1 change: 1 addition & 0 deletions fs-sim/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
`Errors` are empty.
* The `Show Errors` instance was not printing every stream.
* The shrinker for `Errors` was not shrinking every stream.
* Adapt to moving of `Util` modules in `fs-api`.

## 0.2.1.1 -- 2023-10-30

Expand Down
3 changes: 1 addition & 2 deletions fs-sim/src/System/FS/Sim/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ import qualified Test.QuickCheck as QC
import Test.QuickCheck (ASCIIString (..), Arbitrary (..), Gen,
suchThat)

import Util.CallStack

import System.FS.API
import System.FS.CallStack

import qualified System.FS.Sim.MockFS as MockFS
import System.FS.Sim.MockFS (HandleMock, MockFS)
Expand Down
2 changes: 1 addition & 1 deletion fs-sim/src/System/FS/Sim/MockFS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import System.Posix.Types (ByteCount)

import System.FS.API (BufferOffset (..))
import System.FS.API.Types
import Util.CallStack
import System.FS.CallStack

import qualified System.FS.Sim.FsTree as FS
import System.FS.Sim.FsTree (FsTree (..), FsTreeError (..))
Expand Down
Empty file.
5 changes: 2 additions & 3 deletions fs-sim/test/Test/System/FS/StateMachine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ import Test.Tasty.QuickCheck
import System.FS.API
import System.FS.IO
import qualified System.FS.IO.Internal as F

import Util.CallStack
import Util.Condense
import System.FS.CallStack
import System.FS.Condense

import System.FS.Sim.FsTree (FsTree (..))
import qualified System.FS.Sim.MockFS as Mock
Expand Down

0 comments on commit cec149c

Please sign in to comment.