todoAPI conn = getTodo conn <|> getAllTodos conn
with getTodo conn = do
methodGET
pathParam @Text `is` "todos"
todoID <- pathParam @Int
...
so you need to keep in mind both the order of the alternatives in todoAPI as well as the bodies of the individual handlers. That gets unwieldy very quickly.It also seems likely to lead to the same problems with error handling that you tend to get with combinator parsers, where you usually only get details about the last failing branch, while the interesting failure might have been an earlier one.
Quiz question (I don't know the answer): What happens to a request for /todos/foo?
[1] https://monadic.systems/post7 [2] https://redbean.dev/#lua
The "Get Started" and "View on GitHub" links both have `href="/"`, so they don't work.
MS seems to be doing a bit of Rust these days, so I kind of wonder if the spiritual successor is another, albeit less hardcore, language.
For me, it’s been difficult because I don’t know where the false starts are, and don’t have the unlimited time I once had to wallow and grow without any community support. Other languages are just more approachable, but something eats at me that Haskell is worth it.
To me, it’s like the people who describe a cat as “just like a dog” as a positive trait for the cat. Why deal with the “just like” version if you can have the real thing? Just get a dog. So I find myself reaching for these tools and then I try to just go to the real thing. Unfortunately I can’t run Haskell on an ESP32 :)
Btw, this is not to denigrate cats, they are great in their own right. Not for me, I’m violently allergic and somewhat particular to having the things I ensure exist be thankful, but I respect everyone’s choices in the fluffy friend department.
Sounds like a certain deity