Module

Toestand.Classes

Package
purescript-toestand
Repository
garganscript/purescript-toestand

#Read Source

class Read box val | box -> val where

A Box-like container that can be read from

Members

#Write Source

class Write box val | box -> val where

A Box-like container that can be written to.

Members

  • write :: val -> box -> Effect val

    Write a new value into the box.

#ReadWrite Source

class (Read box val, Write box val) <= ReadWrite box val | box -> val

A shorter way of specify Read+Write

Instances

#write_ Source

write_ :: forall box v. Write box v => v -> box -> Effect Unit

Unit-returning version of write

#modify Source

modify :: forall c v. ReadWrite c v => (v -> v) -> c -> Effect v

Change the value in a Box by applying a function to it.

#modify_ Source

modify_ :: forall box v. ReadWrite box v => (v -> v) -> box -> Effect Unit

Change the value in a Box by applying a function to it.