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

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulemachines-0.7.4Haskell2010

Data.Machine.Type

  • 3 types
  • 1 class
  • 19 values
  • Packagemachines-0.7.4
  • Exports23
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceType.hs

Machines

8 declarations
newtypenewtype MachineT (m :: Type -> Type) (k :: Type -> Type) o
#

A MachineT reads from a number of inputs and may yield results before stopping with monadic side-effects.

Constructors

Instances6Functor, Applicative, Foldable, Pointed, Semigroup, Monoid
valuerunT_ :: Monad m => MachineT m k b -> m ()
#

Stop feeding input into model, taking only the effects.

valuerunT :: Monad m => MachineT m k b -> m [b]
#

Stop feeding input into model and extract an answer

Building machines from plans

valuebefore :: Monad m => MachineT m k o -> PlanT k o m a -> MachineT m k o
#

Evaluate a machine until it stops, and then yield answers according to the supplied model.

Deconstructing machines back into plans

valuefinishWith
  1. :: Monad m
  2. => o -> Maybe r
  3. -> MachineT m k o
  4. -> MachineT m k (Either r o)
#

Use a function to produce and mark a yielded value as the terminal value of a Machine. All yielded values for which the given function returns Nothing are yielded down the pipeline, but the first value for which the function returns a Just value will be returned by a Plan created via deconstruct.

Reshaping machines

6 declarations

Applicative Machines

1 declaration