... | ... | @@ -139,6 +139,30 @@ This is mostly an internal refactoring, but it can affect users of the GHC API i |
|
|
|
|
|
To adapt to this change, you might need to define new instances or add contexts to satisfy these superclass constraints. A detailed migration guide is available [here](https://github.com/haskell/core-libraries-committee/blob/main/guides/functor-combinator-instances-and-class1s.md).
|
|
|
|
|
|
### `transformers` 0.6: new `MonadTrans` quantified context
|
|
|
|
|
|
GHC 9.6 bundles `transformers-0.6` which adds a quantified `Monad` context to the `MonadTrans` typeclass:
|
|
|
|
|
|
```diff
|
|
|
-class MonadTrans t
|
|
|
+class (forall m. Monad m => Monad (t m)) => MonadTrans t
|
|
|
```
|
|
|
|
|
|
Adapting to this change will require adding missing `Monad` instances, or adding extra contraints in a context to ensure that an existing `Monad` instance can be satisfied. For example, if one had:
|
|
|
|
|
|
```
|
|
|
data T u m a = ...
|
|
|
|
|
|
instance Ctxt u => Monad (T u m) where { .. }
|
|
|
instance MonadTrans (T u) where { .. }
|
|
|
```
|
|
|
|
|
|
one will need to add the `Monad` context to the `MonadTrans` instance:
|
|
|
|
|
|
```haskell
|
|
|
instance Ctxt u => MonadTrans (T u) where { .. }
|
|
|
```
|
|
|
|
|
|
### New quantified `Functor` superclass on `Bifunctor`
|
|
|
|
|
|
As per [CLC proposal #91](https://github.com/haskell/core-libraries-committee/issues/91), the `Bifunctor` class has a new `Functor` superclass:
|
... | ... | @@ -148,7 +172,7 @@ As per [CLC proposal #91](https://github.com/haskell/core-libraries-committee/is |
|
|
+class (forall a. Functor (bi a)) => Bifunctor bi
|
|
|
```
|
|
|
|
|
|
Adapting to this change might require defining missing `Functor` instances for types implementing the `Bifunctor` class.
|
|
|
Adapting to this change might require defining missing `Functor` instances for types implementing the `Bifunctor` class, or adding extra contexts, similarly to the previous two subsections.
|
|
|
|
|
|
### `mtl` 2.3 changes
|
|
|
|
... | ... | @@ -165,29 +189,3 @@ GHC now bundles `mtl` 2.3, which includes some non-backwards-compatible changes: |
|
|
GHC 9.6 bundles `directory-1.3.8.0`. The modules exported by this library are no longer considered `Safe` by `SafeHaskell`.
|
|
|
|
|
|
This means that modules that import modules from `directory` can no longer be marked as `Safe`. To address this, you might need to mark these modules as `Trustworthy` instead. |
|
|
|
|
|
### `transformers` 0.6: `MonadTrans` quantified context
|
|
|
|
|
|
GHC 9.6 bundles `transformers-0.6` which adds a quantified `Monad` context to the `MonadTrans` typeclass:
|
|
|
|
|
|
```diff
|
|
|
-class MonadTrans t
|
|
|
+class (forall m. Monad m => Monad (t m)) => MonadTrans t
|
|
|
```
|
|
|
|
|
|
Adapting to this change will require adding missing `Monad` instances, or adding extra contraints in a context to ensure that an existing `Monad` instance can be satisfied. For example, if one had:
|
|
|
|
|
|
```
|
|
|
data T u m a = ...
|
|
|
|
|
|
instance Ctxt u => Monad (T u m) where { .. }
|
|
|
instance MonadTrans (T u) where { .. }
|
|
|
```
|
|
|
|
|
|
one will need to add the `Monad` context to the `MonadTrans` instance:
|
|
|
|
|
|
```haskell
|
|
|
instance Ctxt u => MonadTrans (T u) where { .. }
|
|
|
```
|
|
|
|
|
|
|