mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00

Implements the new `module` header syntax as described in "module and package changes" [1]: ``` module [Request, Response, req] ``` The old syntax should still work fine, and is automatically upgraded to the new one when running `roc format`. [1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit
15 lines
304 B
Text
15 lines
304 B
Text
module [Action, none, update, map]
|
|
|
|
Action state : [None, Update state]
|
|
|
|
none : Action *
|
|
none = None
|
|
|
|
update : state -> Action state
|
|
update = Update
|
|
|
|
map : Action a, (a -> b) -> Action b
|
|
map = \action, transform ->
|
|
when action is
|
|
None -> None
|
|
Update state -> Update (transform state)
|