
CommunityNews
IHP – A Haskell web framework
IHP is a modern batteries-included haskell web framework, built on top of Haskell and Nix.
We believe that functional programing is the future of software development and want to make functional programing with haskell and nix available to anyone. We try to offer a solution which can be used by developers who have not worked with haskell yet. IHP comes with everything you need to build great web applications with haskell and nix. We have made a lot of pragmatic decision to get you started faster. This way you can just pick up haskell along the way
IHP stands for Integrated Haskell Platform.
This thread was posted by one of our members via one of our automated news source trackers.
Most Liked

SmithyTT
Example controller
module Web.Controller.Posts where
import Web.Controller.Prelude
import Web.View.Posts.Index
import Web.View.Posts.New
import Web.View.Posts.Edit
import Web.View.Posts.Show
import qualified Text.MMark as MMark
instance Controller PostsController where
action PostsAction = do
posts <- query @Post
|> orderByDesc #createdAt
|> fetch
render IndexView { .. }
action NewPostAction = do
let post = newRecord
render NewView { .. }
action ShowPostAction { postId } = do
post <- fetch postId
>>= pure . modify #comments (orderByDesc #createdAt)
>>= fetchRelated #comments
render ShowView { .. }
action EditPostAction { postId } = do
post <- fetch postId
render EditView { .. }
action UpdatePostAction { postId } = do
post <- fetch postId
post
|> buildPost
|> ifValid \case
Left post -> render EditView { .. }
Right post -> do
post <- post |> updateRecord
setSuccessMessage "Post updated"
redirectTo EditPostAction { .. }
action CreatePostAction = do
let post = newRecord @Post
post
|> buildPost
|> ifValid \case
Left post -> render NewView { .. }
Right post -> do
post <- post |> createRecord
setSuccessMessage "Post created"
redirectTo PostsAction
action DeletePostAction { postId } = do
post <- fetch postId
deleteRecord post
setSuccessMessage "Post deleted"
redirectTo PostsAction
buildPost post = post
|> fill @["title","body"]
|> validateField #title nonEmpty
|> validateField #body nonEmpty
|> validateField #body isMarkdown
isMarkdown :: Text -> ValidatorResult
isMarkdown text =
case MMark.parse "" text of
Left _ -> Failure "Please provide valid Markdown"
Right _ -> Success
Lot of unusual looking syntax

AstonJ
Just watching this now… looks pretty neat (and different!) you add tables and columns via the web gui - you even create controllers via it, don’t think I’ve seen that in a web framework before:
Popular Backend topics










Other popular topics









Latest in Backend
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /js
- /rails
- /python
- /swift
- /haskell
- /java
- /emacs
- /svelte
- /onivim
- /crystal
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /ocaml
- /opensuse
- /centos
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /lisp
- /textmate
- /sublime-text
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /lua
- /slackware
- /c
- /julia
- /neovim
- /vapor
- /laravel
- /rocket
- /deno
- /adonisjs
- /nerves
- /fable
- /c-sharp
- /lunatic
- /angular
- /rocky
- /lfe
- /nim
- /prolog
- /zotonic
- /actix