6 ms·
I really feel like Snap is a much more pragmatic approach to types. Where Yesod uses tons of metaprogramming and DSLs to make HTML and CSS type safe, Snap focus
by LukeHoersten 13y ago
I really feel like Snap is a much more pragmatic approach to types. Where Yesod uses tons of metaprogramming and DSLs to make HTML and CSS type safe, Snap focuses on being a great Haskell system and HTML/CSS continue to be whatever they are. In practice this seems to be a good trade off because to get type safety in HTML/CSS the way Yesod does, you take on a lot of complexity and black magic.
The one place I wish I had better type safety in Snap is the SQL level. Yesod has Persistent which you can use with Snap but Persistent follows the same "black magic" design principles. I really wish there was a tool that handled PostgreSQL-specific query type checking and migration and that's it. No JSON/noSQL to SQL abstraction etc (which is cool if you want it but just a lot of if you don't). Once I pick a DB I don't want to constantly be generalizing away from it which is a conceptual overhead.
- alipang 13y agoWhile I agree to some extent, I have to say the metaprogramming in Yesod does a good job at exposing solid information models for its abstractions, unlike, say reflection based metaprogramming in C# or Java. I find it pretty easy to bend it to my will, even if Yesod itself is quite opinionated.