Skip to content

Commit e8b1754

Browse files
authored
Merge pull request #18 from justinwoo/modify-void
add modify_ for void modify
2 parents 5041ba4 + 35dd274 commit e8b1754

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Effect/Ref.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ foreign import modify' :: forall s b. (s -> { state :: s, value :: b }) -> Ref s
2929
modify :: forall s. (s -> s) -> Ref s -> Effect s
3030
modify f = modify' \s -> let s' = f s in { state: s', value: s' }
3131

32+
modify_ :: forall s. (s -> s) -> Ref s -> Effect Unit
33+
modify_ f s = void $ modify f s
34+
3235
-- | Update the value of a mutable reference to the specified value.
3336
foreign import write :: forall s. s -> Ref s -> Effect Unit

0 commit comments

Comments
 (0)