Skip to content

Provide versions of handle{Cast|Call}_ that work in the Process monad #57

@hyperthunk

Description

@hyperthunk

Consider these two cast handlers:

handleCastIf_ (\(c :: String, _ :: Delay) -> c == "timeout")
                            (\("timeout", Delay d) -> timeoutAfter_ d),
handleCast    (\s' ("ping", pid :: ProcessId) ->
                                 send pid "pong" >> continue s')

There's no great reason why we shouldn't be able to skip the state in the latter as we do with the former, but the continue_ function returns (s -> Process (ProcessAction s)) which means it can't be used in monadic code like this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions