beck / module todoSource

Module todo

Interface digest 802bcf6ddfbd5c3c9b46e30414902831 · 1/19 published names documented

Types

Id

type Id = newtype[Str]

Todo

model Todo
Field
id: Id
text: Str
done: Bool
owner: Str

State

model State
Field
todos: Map[Id, Todo]

Command

union Command
Variant
Add(id: Id, text: Str)
Toggle(id: Id)
Delete(id: Id)

Event

union Event
Variant
Added(id: Id, text: Str)
Toggled(id: Id)
Deleted(id: Id)

Rejection

union Rejection
Variant
BlankText
IdTaken
NoSuchTodo
NotOwner

Names

NameRuns onEffects
apply_eventanyno effects
done_classanyno effects
eventsserverno effects
if_ownedanyno effects
mineanyno effects
pageclientno effects
proposalsserveringress
remaininganyno effects
renderanyno effects
todosdatadurable
toggledanyno effects
validateanyno effects
viewanyno effects

apply_event

apply_event(s: State, env: Envelope[Event]) -> State

defon anyno effects

done_class

done_class(t: Todo) -> Str

defon anyno effects

Every class this page carries is a utility the compiler knows, so `beck build` emits a rule for each of them and nothing else (`docs/104` §104.4). `done` used to be this program's own name for a rule in `beck-rt`'s hard-coded sheet; `line-through` is the same look with nothing hard-coded.

The shared classes are written once and the one that varies is a name beside them, which is `docs/104` §104.4's own example: `class=[…, done_class(t)]`. Both arms are literals, so the compiler enumerates both and emits a rule for each — following the list, the call and the branch, which is the chain §104.4 item 4 is about.

events

events: Stream[Event]

signalon serverno effects

if_owned

if_owned(s: State, p: Proposal, id: Id, evs: list[Event]) -> Result[list[Event], Rejection]

defon anyno effects

mine

mine(s: State, session: Session) -> list[Todo]

defon anyno effects

page

page: Signal[Html]

signalon clientno effects

proposals

proposals: Stream[Proposal]

signalon serveringress

remaining

remaining(todos: list[Todo]) -> Int

defon anyno effects

render

render(todos: list[Todo], left: Int) -> Html

defon anyno effects

todos

todos: Signal[State]

signalon datadurable

toggled

toggled(s: State, id: Id) -> State

defon anyno effects

validate

validate(s: State, p: Proposal) -> Result[list[Event], Rejection]

defon anyno effects

view

view(s: State, session: Session) -> Html

defon anyno effects