Live data from Hacker News

Okapi – A micro web framework for Haskell

okapi.wiki

21–28 of 28 posts

Re: Okapi – A micro web framework for Haskell

#21
The way this does routing leads to quite hard to read code, compare https://www.okapi.wiki/docs/todo-app:

    todoAPI conn = getTodo conn  getAllTodos conn
with

    getTodo conn = do
      methodGET
      pathParam @Text `is` "todos"
      todoID 
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?

Re: Okapi – A micro web framework for Haskell

#22
post #9
post #6

Earlier quoted context omitted.

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.

Do you write web applications in Haskell? It’s not clear where the community is, and that’s troublesome because for those not well oriented with Haskell, the adventure is solitary. 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 unlim…

Web application/service development is probably the most mature domain in Haskell's ecosystem after compilers & interpreters. Maybe it even exceeds that since so many people are using it.

There are plenty of people doing it for their jobs.

Re: Okapi – A micro web framework for Haskell

#23
post #3
post #2

Haskell for web? That's very impressive if you can get it to work at scale. This is the hardest language I have ever personally tried to learn.

monads still keep me awake at night

At first I thought you meant Monad Lisa.

I will show myself out.

Re: Okapi – A micro web framework for Haskell

#25
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.

Re: Okapi – A micro web framework for Haskell

#26
post #6
post #2

Haskell for web? That's very impressive if you can get it to work at scale. This is the hardest language I have ever personally tried to learn.

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.

Michael used to write lots of great Haskell material. I experimented with Yesod but used Spock (really simple framework) more. For business reasons, his company now supports non-Haskell languages.

Re: Okapi – A micro web framework for Haskell

#27
post #9
post #6

Earlier quoted context omitted.

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.

Do you write web applications in Haskell? It’s not clear where the community is, and that’s troublesome because for those not well oriented with Haskell, the adventure is solitary. 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 unlim…

Yes, I used to write web applications in Haskell. I did that before Rust was viable for writing web applications (and way before Rust reached 1.0). The community has IMO become a bit smaller after Rust became so popular.

I still miss HKT and the productivity benefits from those (the classic mostly true joke is that there are multiple npm packages whose entire functionality can be replaced by a single function in the standard library, `traverse`), but Rust's traits system is good enough.

Re: Okapi – A micro web framework for Haskell

#28
post #7
post #3

Earlier quoted context omitted.

monads still keep me awake at night

Monads are only complicated if you have to unlearn stuff. You've probably written a ton of monads by accident, regardless of what language you use.

exactly, I finally got them when looking at examples in other languages. I never could shake the interest off because I caught a glimpse of god when trying haskell. The language didn't stick on me but I always miss haskell monads.
Post reply on HN