Module

Specular.Ref

Package
purescript-specular
Repository
restaumatic/purescript-specular

#Ref Source

data Ref a

Constructors

Instances

#new Source

new :: forall m a. MonadEffect m => a -> m (Ref a)

Create a new Ref with an initial value.

#newWithEvent Source

newWithEvent :: forall m a. MonadFRP m => a -> Event (a -> a) -> m (Ref a)

#const Source

const :: forall a. a -> Ref a

Create a Ref with a value

#value Source

value :: forall a. Ref a -> Dynamic a

The current value of the Ref, as a Dynamic.

#modify Source

modify :: forall a m. MonadEffect m => Ref a -> (a -> a) -> m Unit

Modify value of this Ref using a function.

#read Source

read :: forall m a. MonadEffect m => Ref a -> m a

Read the current value of a Ref

#write Source

write :: forall a m. MonadEffect m => Ref a -> a -> m Unit

Overwrite value of this Ref.

#focusRef Source

focusRef :: forall s a. Dynamic (Lens s a) -> Ref s -> Ref a

#pureFocusRef Source

pureFocusRef :: forall s a. Lens s a -> Ref s -> Ref a

#previewRef Source

previewRef :: forall s a. Prism s a -> Ref s -> Ref (Maybe a)

#wrapViewWidget Source

wrapViewWidget :: forall m a. MonadWidget m => (WeakDynamic a -> m (Event a)) -> Ref a -> m Unit

#Lens Source

type Lens s a = { get :: s -> a, set :: s -> a -> s }

#Prism Source

type Prism s a = { preview :: s -> Maybe a, review :: a -> s }

#newRef Source

newRef :: forall m a. MonadEffect m => a -> m (Ref a)

Old name for new.

#newRefWithEvent Source

newRefWithEvent :: forall m a. MonadFRP m => a -> Event (a -> a) -> m (Ref a)

Old name for newWithEvent

#constRef Source

constRef :: forall a. a -> Ref a

Old name for const

#readRef Source

readRef :: forall m a. MonadEffect m => Ref a -> m a

Old name for read

#updateRef Source

updateRef :: forall a m. MonadEffect m => Ref a -> a -> m Unit

#set Source

set :: forall a m. MonadEffect m => Ref a -> a -> m Unit

Old name for write

#refUpdateConst Source

refUpdateConst :: forall a m. MonadEffect m => Ref a -> a -> m Unit

Old name for write.

#refValue Source

refValue :: forall a. Ref a -> Dynamic a

Old name for value

#refUpdate Source

refUpdate :: forall a m. MonadEffect m => Ref a -> (a -> a) -> m Unit

Old name for modify.