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?
Looks really nice but I haven’t tried it yet. I wrote a small book on my take on Haskell programming using a small subset of the language (read for free on my web site https://markwatson.com). When I update my book I might add an Okapi example. I have played around with Spock for simple web apps and that is nice enough, but I am really impressed by the care in putting together the Okapi documentation web site. Great material, nicely presented.
The author of this framework is also doing very interesting work on building Haskell server pages [1], taking inspiration from redbean's Lua server pages[2].
Of course you can. As early as 2012, Michael Snoyman has written a book about it, Developing Web Applications with Haskell and Yesod. Yesod is an old web framework by now, but it's not even the oldest. Happstack is even older than that.
Have you tried C? I’m not being snarky, remembering all the undefined behavior is a task in itself. I’m a Haskell neophyte, but I often find myself reaching for things haskell has in the box when I’m writing something in another language.
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.
rstarast|3 years ago
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?
mark_l_watson|3 years ago
njrc9|3 years ago
[1] https://monadic.systems/post7 [2] https://redbean.dev/#lua
__derek__|3 years ago
The "Get Started" and "View on GitHub" links both have `href="/"`, so they don't work.
vector_spaces|3 years ago
jbirer|3 years ago
revskill|3 years ago
badrabbit|3 years ago
kccqzy|3 years ago
MarkMarine|3 years ago
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.
kobalsky|3 years ago