Dispatching to specific chains for specific values allows for an easy switch/dispatch/fork/... behaviour. The dict class and its literals could easily represent it:
pre_chain >> {
# key => chain dispatches
str: int,
float: round,
# how to transform a value to derive a key
'__transform__': type,
# what to do if the key matches no case
'__default__': lambda value: value # do nothing if no key matches
} >> post_chain
Dispatching to specific chains for specific values allows for an easy switch/dispatch/fork/... behaviour. The
dict
class and its literals could easily represent it:value
=>chain
, then pushvalue
alongchain
__double_underscore__
names