digitallyinduced / ihp

🔥 The fastest way to build type safe web apps. IHP is a new batteries-included web framework optimized for longterm productivity and programmer happiness
https://ihp.digitallyinduced.com/
MIT License
4.93k stars 195 forks source link

Syntax and Higher level features #221

Closed erlandsona closed 4 years ago

erlandsona commented 4 years ago

Curious where the #fieldName syntax comes from? I'm familiar with the -XTypeApplications extension I see being used to reference @User but the only reference to the pound symbol I found in the code base was in TH.

Also how do you handle more complex UI cases like Pagination+Infinite Scroll, or how/do you see a use case for generalizing certain CUD operations and what would/could that look like in IHP? I imagine Queries will always have to be fairly custom but along those lines generally pagination can / should be applied to anything that returns a list, no? Generally, I'm excited about the potential of the framework but I wonder how it compares to a Tierless approach like Lamdera (Elm), Eliom (OCaml), or Blazor (F#)?

mpscholten commented 4 years ago

The #fieldName syntax is defined in IHP.HaskellSupport by providing an IsLabel instance: https://github.com/digitallyinduced/ihp/blob/master/IHP/HaskellSupport.hs#L66

I agree that it would be valuable to have a generic pagination module. Right now we usually do this very manually.

Generally, I'm excited about the potential of the framework but I wonder how it compares to a Tierless approach like Lamdera (Elm), Eliom (OCaml), or Blazor (F#)?

These look really cool. I think when comparing these solutions with IHP, the difference is that IHP is not changing the programing style as much as these frameworks do. IHP "feels" a lot like a typical web framework (e.g. coming from symfony, rails, django, etc. IHP is not too different), while e.g. Lamdera is more a application runtime :)

erlandsona commented 4 years ago

Took me a second to make the connection to -XOverloadedLabels extension which provides the #name syntax desugaring. But that makes sense!

Pagination while e.g. Lamdera is more a application runtime :)

fair enough.