cometia0/messenger-core/2.0.0

Messenger.Recursion

Recursion

This module provides the signature for the updater

type alias Updater a b c d =
a -> c -> b -> ( a, List ( d, b ), c )

The updater a: message sender (object) b: message c: environment messages d: target

type alias Matcher a d =
a -> d -> Bool

Return true if the target is the sender (second argument)

type alias Super d =
d -> Bool

Return true if the target is the parent

type alias Cleaner c =
c -> c

Clean the environment

type alias RecBody a b c d =
{ update : Updater a b c d
, match : Matcher a d
, super : Super d
, clean : Cleaner c
}

RecBody type.

Pass this as an argument to the updater