Skip to content

Commit

Permalink
Update Var.purs
Browse files Browse the repository at this point in the history
  • Loading branch information
srghma authored Jan 27, 2022
1 parent 5d459b3 commit 2434ab2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Control/Monad/Eff/Var.purs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
-- | `Var`s allow to provide a uniform read/write access to the references in
-- | the `Eff` monad. This is mostly useful when making low-level FFI bindings.
-- | the `Effect` monad. This is mostly useful when making low-level FFI bindings.

-- | For example we might have some global counter with the following API:
-- | ```purescript
-- | foreign import data COUNT :: !
-- | getCounter :: forall eff. Eff (count :: COUNT | eff) Int
-- | setCounter :: forall eff. Int -> Eff (count :: COUNT | eff) Unit
-- | getCounter :: Effect Int
-- | setCounter :: Int -> Effect Unit
-- | ```
-- |
-- | `getCounter` and `setCounter` can be kept together in a `Var`:
-- | ```purescript
-- | counter :: forall eff. Var (count :: COUNT | eff) Int
-- | counter :: Var Int
-- | counter = makeVar getCounter setCounter
-- | ```
-- |
Expand Down

0 comments on commit 2434ab2

Please sign in to comment.