diff --git a/CHANGELOG.md b/CHANGELOG.md index ee62052d..94508115 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ and this project adheres to ([#268](https://github.com/lsrcz/grisette/pull/268)) - The `choose*Fresh` functions will not try its best to minimize the size of the guards. ([#283](https://github.com/lsrcz/grisette/pull/283)) +- `EvalModeConvertible` is now reflexive. + ([#284](https://github.com/lsrcz/grisette/pull/284)) ### Fixed diff --git a/src/Grisette/Internal/Unified/Util.hs b/src/Grisette/Internal/Unified/Util.hs index 70ed9286..5164fa88 100644 --- a/src/Grisette/Internal/Unified/Util.hs +++ b/src/Grisette/Internal/Unified/Util.hs @@ -83,6 +83,12 @@ class ((c ~ 'S, s ~ 'S) => r) -> r +instance {-# INCOHERENT #-} (DecideEvalMode c) => EvalModeConvertible c c where + withModeConvertible con sym = withMode @c con sym + {-# INLINE withModeConvertible #-} + withModeConvertible' con _ sym = withMode @c con sym + {-# INLINE withModeConvertible' #-} + instance {-# INCOHERENT #-} (DecideEvalMode s) => EvalModeConvertible 'C s where withModeConvertible con _ = con {-# INLINE withModeConvertible #-}