Live data from Hacker News

Developing Web Applications with Haskell

docs.google.com

21–30 of 33 posts

Re: Developing Web Applications with Haskell

#21

Earlier quoted context omitted.

Don't forget about reflex[0], you can try it here[1]. I also use purescript[2] with purescript-halogen[3] as does slamdata[4]. There's also a video on Purescript halogen[5] that's very interesting. Purescript is great because the JavaScript it generates is so readable, that if you really need to you can understand the output and make micro-optimizations. 0: https://github.com/ryantrinkle/reflex 1: https://github.com/…

Thanks for the links! I'm really curious about what Haskell can come up with for a front-end story. Do you think that Purescript's row typing (as seen in records and the Eff monad/effect system) is a viable replacement for monad transformer stacks? I "get" MT stacks but I find them heavyweight when what is most often desired is commutative set building of capabilities rather than MT-style stacking.

Consider mtl then. It provides commutative capability set building semantics from the user's POV and then only asks the consumer to make final stack-ordering/effect specification decisions.

Re: Developing Web Applications with Haskell

#24
post #3

I'd like to see something like this, but with JSON-based APIs instead of HTML templating.

(Author here) There is a set of exercises that come with the slides at https://github.com/serras/lambdaconf-2015-web In particular, they introduce the Aeson library for both producing and consuming JSON.

Re: Developing Web Applications with Haskell

#26

I'm somewhat new to web dev and new to functional programming. Can someone tell me how this is fundamentally different that ClojureScript + OM ( https://github.com/omcljs/om ) ?

Fundamentally, I guess the difference is that one is type-safe, and the other isn't.

You can get compile time errors instead of runtime for bunch of things.

Re: Developing Web Applications with Haskell

#27
post #20
post #6

Does it support a "React" style of building web applications?

There are a number of Haskell-to-JS compilers and Haskell-alike languages which more directly target JS. This is growing quickly but major issues remain and the toolkits are quite immature. On the other hand, much of React is a natural play out of Haskell's sweet spot. The challenge will be in making Js-alike APIs which handle the flexibility well while maintaining sufficient typing. React-like rendering, virtualdom,…

I recently had a great experience with GHCJS, although I wouldn't really say I'm using it in anger.

Re: Developing Web Applications with Haskell

#28

I'm somewhat new to web dev and new to functional programming. Can someone tell me how this is fundamentally different that ClojureScript + OM ( https://github.com/omcljs/om ) ?

Fundamentally, I guess the difference is that one is type-safe, and the other isn't. You can get compile time errors instead of runtime for bunch of things.

ClojureScript also, I think, has a better front-end story for squishier front ends at the moment (although there are a number of projects working on changing that).

Re: Developing Web Applications with Haskell

#29
post #3

I'd like to see something like this, but with JSON-based APIs instead of HTML templating.

I believe the HTML templating stuff is pretty optional in all the major Haskell web platforms. I know in Yesod it is trivial to serve JSON rather than HTML from an end-point, and pretty easy to serve multiple representations of the same resource.

Re: Developing Web Applications with Haskell

#30
post #21

Earlier quoted context omitted.

Thanks for the links! I'm really curious about what Haskell can come up with for a front-end story. Do you think that Purescript's row typing (as seen in records and the Eff monad/effect system) is a viable replacement for monad transformer stacks? I "get" MT stacks but I find them heavyweight when what is most often desired is commutative set building of capabilities rather than MT-style stacking.

Consider mtl then. It provides commutative capability set building semantics from the user's POV and then only asks the consumer to make final stack-ordering/effect specification decisions.

I find mtl pretty close to a sweet spot. The one thing I wish for is to be able to constrain effect order as a user (using your terminology above) when I'm writing code where one ordering or another is incorrect. The closest I can come is to fix the top of the stack, which suffices for correctness but puts some unnecessary burden on the consumer.
Post reply on HN