diff --git a/changelog.d/pr-1848 b/changelog.d/pr-1848 new file mode 100644 index 000000000..a3ec48464 --- /dev/null +++ b/changelog.d/pr-1848 @@ -0,0 +1,12 @@ +synopsis: Derive `Read` instance for `Scheme` in `BaseUrl` +packages: servant-client-core +prs: #1848 +issues: #1847 +description: { + Added a `Read` instance to the `Scheme` data type in `BaseUrl` via the + `deriving` clause. This allows parsing `Scheme` values from strings using + the standard `Read` mechanism. + + This change improves compatibility with libraries like `config-ini` + that rely on the `Read` typeclass for parsing configuration values. +} diff --git a/servant-client-core/src/Servant/Client/Core/BaseUrl.hs b/servant-client-core/src/Servant/Client/Core/BaseUrl.hs index 935952948..4a5aec71f 100644 --- a/servant-client-core/src/Servant/Client/Core/BaseUrl.hs +++ b/servant-client-core/src/Servant/Client/Core/BaseUrl.hs @@ -32,7 +32,7 @@ data Scheme Http | -- | https:// Https - deriving (Data, Eq, Generic, Lift, Ord, Show) + deriving (Data, Eq, Generic, Lift, Ord, Read, Show) -- | Simple data type to represent the target of HTTP requests -- for servant's automatically-generated clients.