HORIZON HASKELLDocslts/ghc-10.0.xc7d136e2026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c7d136e · 2026-10-12

Modulemiso-1.12.0.0

Miso

  • 57 types
  • 7 classes
  • 290 values
value(#>) :: IO action -> model -> Effect parent props model action
#
value(<#) :: model -> IO action -> Effect parent props model action
#
valueio :: IO action -> Effect parent props model action
#
valueissue :: action -> Effect parent props model action
#
valuenoop :: action -> Effect parent props model action
#
valueparent :: (parent -> action) -> action -> Effect parent props model action
#
valuecomponent
  1. :: model
  2. -> action -> Effect parent props model action
  3. -> props -> model -> View model action
  4. -> Component parent props model action
#
valuevcomp
  1. :: model
  2. -> action -> Effect parent props model action
  3. -> props -> model -> View model action
  4. -> Component parent props model action
#
value(=:) :: k -> v -> (k, v)
#
valueasks
  1. :: MonadReader r m
  2. => (r -> a)

    The selector function to apply to the environment.

  3. -> m a
#

Retrieves a function of the current environment.

valuegets :: MonadState s m => (s -> a) -> m a
#

Gets specific component of the state, using a projection function supplied.

valuemodify :: MonadState s m => (s -> s) -> m ()
#

Monadic state transformer.

Maps an old state to a new state inside a state monad. The old state is thrown away.

     Main> :t modify ((+1) :: Int -> Int)
     modify (...) :: (MonadState Int a) => a ()

This says that modify (+1) acts over any Monad that is a member of the MonadState class, with an Int state.

valuemodify' :: MonadState s m => (s -> s) -> m ()
#

A variant of modify in which the computation is strict in the new state.

methodliftIO :: IO a -> m a
#

Lift a computation from the IO monad. This allows us to run IO computations in any monadic stack, so long as it supports these kinds of operations (i.e. IO is the base monad for the stack).

Example
import Control.Monad.Trans.State -- from the "transformers" library

printState :: Show s => StateT s IO ()
printState = do
  state <- get
  liftIO $ print state

Had we omitted liftIO, we would have ended up with this error:

• Couldn't match type ‘IO’ with ‘StateT s IO’
 Expected type: StateT s IO ()
   Actual type: IO ()

The important part here is the mismatch between StateT s IO () and IO ().

Luckily, we know of a function that takes an IO a and returns an (m a): liftIO, enabling us to run the program and see the expected results:

> evalStateT printState "hello"
"hello"

> evalStateT printState 3
3
datadata JSVal
#
Instances10Eq, NFData, PFromJSVal, PToJSVal, FromJSVal, ToArgs, …
  • Eq JSValDefined in miso-1.12.0.0 · Miso.DSL.FFI · orphan
  • NFData JSValDefined in ghcjs-base-0.8.0.4 · GHCJS.Internal.Types · orphan
  • FromJSVal JSValDefined in ghcjs-base-0.8.0.4 · GHCJS.Marshal · orphan
  • ToJSVal JSValDefined in ghcjs-base-0.8.0.4 · GHCJS.Marshal · orphan
  • PFromJSVal JSValDefined in ghcjs-base-0.8.0.4 · GHCJS.Marshal.Pure · orphan
  • PToJSVal JSValDefined in ghcjs-base-0.8.0.4 · GHCJS.Marshal.Pure · orphan
  • FromJSVal JSValDefined in miso-1.12.0.0 · Miso.DSL
  • ToArgs JSValDefined in miso-1.12.0.0 · Miso.DSL
  • ToJSVal JSValDefined in miso-1.12.0.0 · Miso.DSL
  • ToObject JSValDefined in miso-1.12.0.0 · Miso.DSL
datadata Binding parent child
#

Constructors

  • forall field. ParentToChild (parent -> field) (field -> child -> child)
  • forall field. ChildToParent (field -> parent -> parent) (child -> field)
  • forall field. Bidirectional Precedence (parent -> field) (field -> parent -> parent) (child -> field) (field -> child -> child)
classclass FromJSVal a where
#
Instances45FromJSVal, …
classclass GFromJSVal (f :: Type -> Type) where
#

Methods

Instances7GFromJSVal, …
classclass GToJSVal (f :: Type -> Type) where
#

Methods

Instances7GToJSVal, …
classclass ToArgs args where
#

Methods

Instances25ToArgs, …
classclass ToJSVal a where
#

Methods

Instances62ToJSVal, …
classclass ToObject a where
#

Methods

Instances15ToObject, …
typetype Sink action = action -> IO ()
#
newtypenewtype KeyCode
#

Constructors

Instances5Eq, Num, Ord, Show, FromJSON
  • Eq KeyCodeDefined in miso-1.12.0.0 · Miso.Event.Types
  • Num KeyCodeDefined in miso-1.12.0.0 · Miso.Event.Types
  • Ord KeyCodeDefined in miso-1.12.0.0 · Miso.Event.Types
  • Show KeyCodeDefined in miso-1.12.0.0 · Miso.Event.Types
  • FromJSON KeyCodeDefined in miso-1.12.0.0 · Miso.Event.Types
newtypenewtype Blob
#

Constructors

Instances3Eq, FromJSVal, ToJSVal
  • Eq BlobDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • FromJSVal BlobDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • ToJSVal BlobDefined in miso-1.12.0.0 · Miso.FFI.Internal
newtypenewtype Date
#

Constructors

Instances3Eq, ToJSVal, ToObject
  • Eq DateDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • ToJSVal DateDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • ToObject DateDefined in miso-1.12.0.0 · Miso.FFI.Internal
newtypenewtype Event
#

Constructors

Instances3Eq, FromJSVal, ToJSVal
  • Eq EventDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • FromJSVal EventDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • ToJSVal EventDefined in miso-1.12.0.0 · Miso.FFI.Internal
newtypenewtype File
#

Constructors

Instances4Eq, FromJSVal, ToJSVal, ToObject
  • Eq FileDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • FromJSVal FileDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • ToJSVal FileDefined in miso-1.12.0.0 · Miso.FFI.Internal
  • ToObject FileDefined in miso-1.12.0.0 · Miso.FFI.Internal
newtypenewtype Topic a
#
Instances4Eq, Ord, Show, ToMisoString
  • Eq (Topic a)Defined in miso-1.12.0.0 · Miso.Runtime
  • Ord (Topic a)Defined in miso-1.12.0.0 · Miso.Runtime
  • Show (Topic a)Defined in miso-1.12.0.0 · Miso.Runtime
  • ToMisoString (Topic a)Defined in miso-1.12.0.0 · Miso.Runtime
newtypenewtype Key
#

Constructors

Instances7Eq, Show, IsString, ToJSVal, ToMisoString, ToKey, …
  • Eq KeyDefined in miso-1.12.0.0 · Miso.Types
  • Show KeyDefined in miso-1.12.0.0 · Miso.Types
  • IsString KeyDefined in miso-1.12.0.0 · Miso.Types
  • ToJSVal KeyDefined in miso-1.12.0.0 · Miso.Types
  • ToMisoString KeyDefined in miso-1.12.0.0 · Miso.Types
  • ToKey KeyDefined in miso-1.12.0.0 · Miso.Types
  • ToJSON KeyDefined in miso-1.12.0.0 · Miso.Types
datadata ROOT
#
Instances1Eq
  • Eq ROOTDefined in miso-1.12.0.0 · Miso.Types
datadata URI
#
Instances10Eq, Show, Generic, ToJSVal, ToObject, ToMisoString, …
methodask :: m r
#

Retrieves the monad environment.

methodget :: m s
#

Return the state from the internals of the monad.

methodput :: s -> m ()
#

Replace the state inside the monad.

methodtell :: w -> m ()
#

tell w is an action that produces the output w.