Skip to content

Commit

Permalink
Explicitly define setByteArray# and setOffAddr# in Prim Ref instance
Browse files Browse the repository at this point in the history
Fixes #263.
  • Loading branch information
arybczak committed Oct 22, 2024
1 parent 4de03c8 commit 86e633b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions effectful-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# effectful-core-2.5.0.0 (????-??-??)
* Add `plusEff` (specialized version of `<|>`) to `Effectful.NonDet` and make
`emptyEff` and `sumEff` generate better call stacks.
* Explicitly define `setByteArray#` and `setOffAddr#` in the `Prim` instance of
`Ref` for `primitive` < 0.9.0.0.
* **Bugfixes**:
- `OnEmptyRollback` strategy of the `NonDet` effect is no longer broken.
* **Breaking changes**:
Expand Down
2 changes: 2 additions & 0 deletions effectful-core/src/Effectful/Internal/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ instance Prim Ref where
s1 = writeByteArray# arr n ref s0
s2 = writeByteArray# arr (n +# 1#) version s1
in s2
setByteArray# = defaultSetByteArray#
indexOffAddr# addr i =
let n = 2# *# i
ref = indexOffAddr# addr n
Expand All @@ -133,6 +134,7 @@ instance Prim Ref where
s1 = writeOffAddr# addr n ref s0
s2 = writeOffAddr# addr (n +# 1#) version s1
in s2
setOffAddr# = defaultSetOffAddr#

-- | Version of the effect.
newtype Version = Version Int
Expand Down
2 changes: 2 additions & 0 deletions effectful/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# effectful-2.5.0.0 (????-??-??)
* Add `plusEff` (specialized version of `<|>`) to `Effectful.NonDet` and make
`emptyEff` and `sumEff` generate better call stacks.
* Explicitly define `setByteArray#` and `setOffAddr#` in the `Prim` instance of
`Ref` for `primitive` < 0.9.0.0.
* **Bugfixes**:
- `OnEmptyRollback` strategy of the `NonDet` effect is no longer broken.
* **Breaking changes**:
Expand Down

0 comments on commit 86e633b

Please sign in to comment.