Skip to content

Commit 610494d

Browse files
authored
Derive Read for Scheme using deriving in BaseUrl (#1848)
* Derive `Read` for `Scheme` using `deriving` in `BaseUrl` (#1847) * Add changelog entry file for PR #1848
1 parent 3d60148 commit 610494d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

changelog.d/pr-1848

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
synopsis: Derive `Read` instance for `Scheme` in `BaseUrl`
2+
packages: servant-client-core
3+
prs: #1848
4+
issues: #1847
5+
description: {
6+
Added a `Read` instance to the `Scheme` data type in `BaseUrl` via the
7+
`deriving` clause. This allows parsing `Scheme` values from strings using
8+
the standard `Read` mechanism.
9+
10+
This change improves compatibility with libraries like `config-ini`
11+
that rely on the `Read` typeclass for parsing configuration values.
12+
}

servant-client-core/src/Servant/Client/Core/BaseUrl.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ data Scheme
3232
Http
3333
| -- | https://
3434
Https
35-
deriving (Data, Eq, Generic, Lift, Ord, Show)
35+
deriving (Data, Eq, Generic, Lift, Ord, Read, Show)
3636

3737
-- | Simple data type to represent the target of HTTP requests
3838
-- for servant's automatically-generated clients.

0 commit comments

Comments
 (0)