free-operational-0.2.0.0: Operational Applicative, Alternative, Monad and MonadPlus, built with free types.

Safe HaskellNone

Control.Alternative.Operational

Description

operational-style Alternative programs. See Control.Applicative.Operational for guidance on how to use this module.

Documentation

newtype ProgramAlt instr a Source

Constructors

ProgramAlt 

Fields

toAlt :: Alt (Yoneda instr) a

Interpret the program as a free Alternative (Alt).

Instances

interpretAlt :: forall instr f a. Alternative f => (forall x. instr x -> f x) -> ProgramAlt instr a -> f aSource

fromProgramAlt :: (Operational instr f, Alternative f) => ProgramAlt instr a -> f aSource

data ProgramViewAlt instr a whereSource

Constructors

Pure :: a -> ProgramViewAlt instr a 
:<**> :: instr a -> ProgramViewAlt instr (a -> b) -> ProgramViewAlt instr b 
Empty :: ProgramViewAlt instr a 
:<|> :: ProgramViewAlt instr a -> ProgramViewAlt instr a -> ProgramViewAlt instr a