Skip to content

Commit

Permalink
🐛 Make EvalModeConvertible reflexive
Browse files Browse the repository at this point in the history
  • Loading branch information
lsrcz committed Jan 18, 2025
1 parent ab6f722 commit 1d61e81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/Grisette/Internal/Unified/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 #-}
Expand Down

0 comments on commit 1d61e81

Please sign in to comment.