Skip to content

Commit e2eced0

Browse files
authored
Merge pull request #88 from input-output-hk/jdral/condense-seekmode
Make the `Condense SeekMode` instance a non-orphan instance
2 parents 4777af3 + 5c65adf commit e2eced0

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
index-state:
22
-- Bump this if you need newer packages from Hackage
3-
, hackage.haskell.org 2024-12-09T15:45:06Z
3+
, hackage.haskell.org 2024-12-30T06:24:32Z
44

55
packages:
66
fs-api

fs-api/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Revision history for fs-api
22

3+
## ?.?.?.? -- ????-??-??
4+
5+
### Non-breaking
6+
7+
* Make the orphan `Condense` instance for `System.IO.SeekMode` into a non-orphan
8+
instance. The instance is still exported from the same modules it was exported
9+
from previously, `System.FS.API.Types` in particular.
10+
311
## 0.3.0.1 -- 2024-10-02
412

513
### Patch

fs-api/src/System/FS/API/Types.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
{-# LANGUAGE RecordWildCards #-}
66
{-# LANGUAGE ScopedTypeVariables #-}
77

8-
-- For Show Errno and Condense SeekMode instances
9-
{-# OPTIONS_GHC -Wno-orphans #-}
108
module System.FS.API.Types (
119
-- * Modes
1210
AllowExisting (..)
@@ -452,11 +450,6 @@ ioToFsErrorType ioErr = case Errno <$> GHC.ioe_errno ioErr of
452450
Condense instances
453451
-------------------------------------------------------------------------------}
454452

455-
instance Condense SeekMode where
456-
condense RelativeSeek = "r"
457-
condense AbsoluteSeek = "a"
458-
condense SeekFromEnd = "e"
459-
460453
instance Condense AllowExisting where
461454
condense AllowExisting = ""
462455
condense MustBeNew = "!"

fs-api/src/System/FS/Condense.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Data.Text (Text, unpack)
2323
import Data.Void
2424
import Data.Word
2525
import Numeric.Natural
26+
import System.IO (SeekMode (..))
2627
import Text.Printf (printf)
2728

2829
{-------------------------------------------------------------------------------
@@ -111,3 +112,8 @@ instance Condense BS.Strict.ByteString where
111112

112113
instance Condense BS.Lazy.ByteString where
113114
condense bs = show bs ++ "<" ++ show (BS.Lazy.length bs) ++ "b>"
115+
116+
instance Condense SeekMode where
117+
condense RelativeSeek = "r"
118+
condense AbsoluteSeek = "a"
119+
condense SeekFromEnd = "e"

0 commit comments

Comments
 (0)