Skip to content

Commit 3b4b2d4

Browse files
committed
Fix tut08 formatting and add IHP
1 parent 0764f09 commit 3b4b2d4

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

tutorials/08_webapp.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ There are several frameworks in Haskell (see [here](https://wiki.haskell.org/Web
132132
- [Snap](http://snapframework.com)
133133
- [Spock](https://www.spock.li)
134134
- [Yesod](https://www.yesodweb.com)
135+
- [IHP](https://ihp.digitallyinduced.com)
135136

136137
As you can see, there is quite an above-average offer of them. They mostly differ at the level of abstraction and scope: Scotty being relatively low-abstraction routing and middleware and Yesod being a complete solution including templating and persistence, everything on a high abstraction level. The choice depends on your preference and needs. As always, a higher abstraction means the system does a lot of job for yourself, you write fewer code, which means a higher effectiveness and less bugs. On the other hand, you may face a [leaky abstraction problem](https://blog.codinghorror.com/all-abstractions-are-failed-abstractions/) at some point.
137138

@@ -219,6 +220,19 @@ main :: IO ()
219220
main = warp 3000 HelloWorld
220221
```
221222

223+
### IHP (Integrated Haskell Platform)
224+
225+
[IHP](https://ihp.digitallyinduced.com/) is a batteries-included web framework for Haskell. It is designed to be easy to use and to provide a lot of functionality out of the box, including:
226+
227+
* A powerful type system that helps catch errors at compile time
228+
* A built-in ORM (Object-Relational Mapping) for working with databases
229+
* A templating engine for generating HTML
230+
* A development server for testing and debugging
231+
232+
IHP is a good choice for developers who want to build web applications quickly and easily, without having to worry about the underlying details of web development. It is also a good choice for developers who want to take advantage of Haskell's powerful type system and functional programming features.
233+
234+
The architecture of IHP is based on the Model-View-Controller (MVC) pattern, which helps to keep the code organized and maintainable. The framework also provides a lot of built-in functionality for common web development tasks, such as authentication, authorization, and database migrations.
235+
222236
### Scotty
223237

224238
[Scotty](https://github.com/scotty-web/scotty) is another Haskell web framework inspired by Ruby's [Sinatra](http://sinatrarb.com), using [WAI](https://hackage.haskell.org/package/wai) and [Warp](https://hackage.haskell.org/package/warp) (a fast, light-weight web server for WAI applications). You can write your own application just with WAI (Web Application Interface), but Scotty provides you with abstractions from a low-level communication. Sadly, there is not so much documentation about Scotty, everything is just on [GitHub](https://github.com/scotty-web/scotty). Scotty uses primarily [Blaze HTML](https://hackage.haskell.org/package/blaze-html) for HTML "templates", however, as we explained, you may also integrate it with any templating library you like.
@@ -629,9 +643,9 @@ The application typically works with a simple entity such as a TODO item.
629643

630644
You will encounter:
631645

632-
* ``Model`` = internal representation used in business logic
633-
* ``DTOs`` (Data Transfer Objects) = types used for JSON input/output
634-
* ``Conversion functions`` = mapping between internal and external representations
646+
* ``Model`` = internal representation used in business logic
647+
* ``DTOs`` (Data Transfer Objects) = types used for JSON input/output
648+
* ``Conversion functions`` = mapping between internal and external representations
635649

636650
### Model and Database
637651

@@ -784,8 +798,8 @@ The homework to complete a simple web app is in repository [MI-AFP/hw08](https:/
784798

785799
## Further reading
786800

787-
* [YesodBook - Persistent](https://www.yesodweb.com/book/persistent)
788-
* [adit.io - Making A Website With Haskell](http://adit.io/posts/2013-04-15-making-a-website-with-haskell.html)
801+
* [YesodBook: Persistent](https://www.yesodweb.com/book/persistent)
802+
* [adit.io: Making A Website With Haskell](http://adit.io/posts/2013-04-15-making-a-website-with-haskell.html)
789803
* [24 Days of Hackage: blaze-html](https://ocharles.org.uk/blog/posts/2012-12-22-24-days-of-hackage-blaze.html)
790804
* [Haskell web frameworks](https://wiki.haskell.org/Web/Frameworks)
791805
* [Reddit: What Haskell web framework do you use and why? ](https://www.reddit.com/r/haskell/comments/332s1k/what_haskell_web_framework_do_you_use_and_why/)

0 commit comments

Comments
 (0)