Read
The plan
A todo app is the classic because it touches everything. The model: the draft text in the input, the list of todos, and which filter is on. Each todo has an id, a title and a done flag.
data Todo = Todo { _tid :: Int, _title :: MisoString, _done :: Bool }
deriving (Show, Eq)
data Filter = All | Active | Completed
deriving (Show, Eq)
data Model = Model
{ _draft :: MisoString
, _todos :: [Todo]
, _filter :: Filter
, _nextId :: Int
} deriving (Show, Eq)
data Action
= Draft MisoString
| Add
| Toggle Int
| Remove Int
| SetFilter FilterThe actions are the verbs of the app. Each one is a few lines in update: Add appends a todo built from the draft and clears the draft; Toggle flips _done of the todo with that id (a map over the list); Remove filters it out.
The view renders the input (controlled), the filtered list (keyed by id, with a checkbox and a remove button each) and three filter buttons. All of it you have written before, in pieces.