@@ -395,7 +395,7 @@ module Control.Distributed.Process.FSM
395
395
, (~@)
396
396
, (~?)
397
397
, (^.)
398
- -- * Useful / Important Types and Utilities
398
+ -- * Types and Utilities
399
399
, Event
400
400
, FSM
401
401
, lift
@@ -426,8 +426,8 @@ import Control.Distributed.Process.FSM.Internal.Types
426
426
import Control.Distributed.Process.Serializable (Serializable )
427
427
import Prelude hiding ((*>) )
428
428
429
- -- | Fluent way to say " yield" when you're building an initial state up (e.g.
430
- -- whilst utilising " begin" ).
429
+ -- | Fluent way to say ' yield' when you're building an initial state up (e.g.
430
+ -- whilst utilising ' begin' ).
431
431
initState :: forall s d . s -> d -> Step s d
432
432
initState = yield
433
433
@@ -437,13 +437,13 @@ yield :: forall s d . s -> d -> Step s d
437
437
yield = Yield
438
438
439
439
-- | Creates an @Event m@ for some "Serializable" type @m@. When passed to
440
- -- functions that follow the combinator pattern (such as " await" ), will ensure
440
+ -- functions that follow the combinator pattern (such as ' await' ), will ensure
441
441
-- that only messages of type @m@ are processed by the handling expression.
442
442
--
443
443
event :: (Serializable m ) => Event m
444
444
event = Wait
445
445
446
- -- | A /prioritised/ version of " event" . The server will prioritise messages
446
+ -- | A /prioritised/ version of ' event' . The server will prioritise messages
447
447
-- matching the "Event" type @m@.
448
448
--
449
449
-- See "Control.Distributed.Process.ManagedProcess.Server.Priority" for more
@@ -452,8 +452,8 @@ pevent :: (Serializable m) => Int -> Event m
452
452
pevent = WaitP . setPriority
453
453
454
454
-- | Evaluates to a "Transition" that instructs the process to enter the given
455
- -- state @s@. All expressions following evaluation of " enter" will see
456
- -- " currentState" containing the updated value, and any future events will be
455
+ -- state @s@. All expressions following evaluation of ' enter' will see
456
+ -- ' currentState' containing the updated value, and any future events will be
457
457
-- processed in the new state.
458
458
--
459
459
-- In addition, should any events/messages have been postponed in a previous
@@ -486,7 +486,7 @@ putBack = return PutBack
486
486
nextEvent :: forall s d m . (Serializable m ) => m -> FSM s d (Transition s d )
487
487
nextEvent m = return $ Push (wrapMessage m)
488
488
489
- -- | As " nextEvent" , but places the message at the back of the queue by default.
489
+ -- | As ' nextEvent' , but places the message at the back of the queue by default.
490
490
--
491
491
-- Mailbox priority ordering will still take precedence over insertion order.
492
492
--
@@ -502,7 +502,7 @@ resume = return Remain
502
502
-- sending its event to the process.
503
503
--
504
504
-- The expression used to produce the reply message must reside in the "FSM" monad.
505
- -- The reply is /not/ sent immediately upon evaluating " reply" , however if the
505
+ -- The reply is /not/ sent immediately upon evaluating ' reply' , however if the
506
506
-- sender supplied a reply channel, the reply is guaranteed to be sent prior to
507
507
-- evaluating the next pass.
508
508
--
@@ -532,7 +532,7 @@ stop = return . Stop
532
532
--
533
533
-- This expression functions as a "Transition" and is not applied immediately.
534
534
-- To /see/ state data changes in subsequent expressions during a single pass,
535
- -- use " yield" instead.
535
+ -- use ' yield' instead.
536
536
set :: forall s d . (d -> d ) -> FSM s d (Transition s d )
537
537
set f = return $ Eval (processState >>= \ s -> setProcessState $ s { stData = (f $ stData s) })
538
538
@@ -543,12 +543,12 @@ set_ f = set f >>= addTransition
543
543
--
544
544
-- This expression functions as a "Transition" and is not applied immediately.
545
545
-- To /see/ state data changes in subsequent expressions during a single pass,
546
- -- use " yield" instead.
546
+ -- use ' yield' instead.
547
547
put :: forall s d . d -> FSM s d ()
548
548
put d = addTransition $ Eval $ do
549
549
processState >>= \ s -> setProcessState $ s { stData = d }
550
550
551
- -- | Synonym for " pick"
551
+ -- | Synonym for ' pick'
552
552
(.|) :: Step s d -> Step s d -> Step s d
553
553
(.|) = Alternate
554
554
infixr 9 .|
@@ -558,7 +558,7 @@ infixr 9 .|
558
558
pick :: Step s d -> Step s d -> Step s d
559
559
pick = Alternate
560
560
561
- -- | Synonym for " begin"
561
+ -- | Synonym for ' begin'
562
562
(^.) :: Step s d -> Step s d -> Step s d
563
563
(^.) = Init
564
564
infixr 9 ^.
@@ -568,7 +568,7 @@ infixr 9 ^.
568
568
begin :: Step s d -> Step s d -> Step s d
569
569
begin = Init
570
570
571
- -- | Synonym for " join" .
571
+ -- | Synonym for ' join' .
572
572
(|>) :: Step s d -> Step s d -> Step s d
573
573
(|>) = Sequence
574
574
infixr 9 |>
@@ -582,10 +582,11 @@ join = Sequence
582
582
(<|) = flip Sequence
583
583
-- infixl 9 <|
584
584
585
+ -- | Join from right to left.
585
586
reverseJoin :: Step s d -> Step s d -> Step s d
586
587
reverseJoin = flip Sequence
587
588
588
- -- | Synonym for " await"
589
+ -- | Synonym for ' await'
589
590
(~>) :: forall s d m . (Serializable m ) => Event m -> Step s d -> Step s d
590
591
(~>) = Await
591
592
infixr 9 ~>
@@ -595,27 +596,27 @@ infixr 9 ~>
595
596
await :: forall s d m . (Serializable m ) => Event m -> Step s d -> Step s d
596
597
await = Await
597
598
598
- -- | Synonym for " safeWait"
599
+ -- | Synonym for ' safeWait'
599
600
(*>) :: forall s d m . (Serializable m ) => Event m -> Step s d -> Step s d
600
601
(*>) = SafeWait
601
602
infixr 9 *>
602
603
603
- -- | A /safe/ version of " await" . The FSM will place a @check $ safe@ filter
604
+ -- | A /safe/ version of ' await' . The FSM will place a @check $ safe@ filter
604
605
-- around all messages matching the input type @m@ of the "Event" argument.
605
606
-- Should an exit signal interrupt the current pass, the input event will be
606
607
-- re-tried if an exit handler can be found for the exit-reason.
607
608
--
608
- -- In all other respects, this API behaves exactly like " await"
609
+ -- In all other respects, this API behaves exactly like ' await'
609
610
safeWait :: forall s d m . (Serializable m ) => Event m -> Step s d -> Step s d
610
611
safeWait = SafeWait
611
612
612
- -- | Synonym for " atState"
613
+ -- | Synonym for ' atState'
613
614
(~@) :: forall s d . (Eq s ) => s -> FSM s d (Transition s d ) -> Step s d
614
615
(~@) = Perhaps
615
616
infixr 9 ~@
616
617
617
618
-- | Given a state @s@ and an expression that evaluates to a "Transition",
618
- -- proceed with evaluation only if the " currentState" is equal to @s@.
619
+ -- proceed with evaluation only if the ' currentState' is equal to @s@.
619
620
atState :: forall s d . (Eq s ) => s -> FSM s d (Transition s d ) -> Step s d
620
621
atState = Perhaps
621
622
@@ -629,11 +630,11 @@ whenStateIs s = s ~@ resume
629
630
allState :: forall s d m . (Serializable m ) => (m -> FSM s d (Transition s d )) -> Step s d
630
631
allState = Always
631
632
632
- -- | Synonym for " allState" .
633
+ -- | Synonym for ' allState' .
633
634
always :: forall s d m . (Serializable m ) => (m -> FSM s d (Transition s d )) -> Step s d
634
635
always = Always
635
636
636
- -- | Synonym for " matching" .
637
+ -- | Synonym for ' matching' .
637
638
(~?) :: forall s d m . (Serializable m ) => (m -> Bool ) -> (m -> FSM s d (Transition s d )) -> Step s d
638
639
(~?) = Matching
639
640
0 commit comments