todo/app/TodoListItem.hs
2025-05-13 20:21:30 +02:00

15 lines
448 B
Haskell

module TodoListItem where
data TodoListItem = TodoListItem
{ name :: String
, done :: Bool
}
instance Show TodoListItem where
show (TodoListItem name done) =
s done ++ " " ++ name ++ "\n"
where
s True = "[x]"
s False = "[ ]"
-- TODO: create a class to render items to html to make it easier to create everything for the website using the web primitives