ihp

ihp

现代化的Haskell Web应用开发框架

IHP是基于Haskell和Nix构建的Web开发框架,提供类型安全、实时重载和一体化开发工具等功能。框架设计便于快速构建可靠的Web应用,适合不同经验水平的开发者使用。IHP支持Windows、macOS等主流操作系统,拥有活跃的社区支持和长期发展规划。它集成了HSX等特性,简化了Web应用的开发过程,特别适合Haskell初学者快速上手。

IHPHaskellWeb框架Nix类型安全Github开源项目
<p align="center"> <a href="https://ihp.digitallyinduced.com/" target="_blank"> <img src="Guide/images/ihp-logo-readme.svg" /> </a> </p> <p align="center"> <img alt="MIT License" src="https://img.shields.io/github/license/digitallyinduced/ihp"> <a href="https://twitter.com/digitallyinduce" target="_blank"> <img src="https://img.shields.io/twitter/follow/digitallyinduce"/> </a> <a href="https://console.algora.io/org/digitallyinduced/bounties?status=open" target="_blank"> <img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fconsole.algora.io%2Fapi%2Fshields%2Fdigitallyinduced%2Fbounties%3Fstatus%3Dopen"/> </a> <img src="https://api.scarf.sh/v2/packages/digitallyinduced/4b7241ee-9679-43fa-9b27-b5595b775c30/downloads-badge"/> </p> <p align="center"> <a href="https://ihp.digitallyinduced.com/" target="_blank"> IHP Website </a> </p>

About IHP

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 decisions to get you started faster. This way you can just pick up haskell along the way :-)

IHP stands for Integrated Haskell Platform.

What makes it different?

Type-safe and reliable: With Haskell and Nix we use the most reliable technologies available, to make sure your application will never crash because of Null Pointer Exceptions.

If you like TypeScript, you will love IHP.

Live Reload: While haskell is a compiled language, the built-in dev server automatically reloads your code changes using the fastest way possible. Changes are reflected instantly. Just like good old PHP.

Live Reload

Watch it in action!

Accessible: Setup of the fully-managed dev environment takes just 5 minutes. All dependencies (even database and compiler) are managed using the nix package manager. This means dependency problems just cannot occur anymore. Also everything is guaranteed to be same for all developers in your team.

No Haskell Experience required: Code Generators will help you to quickly build things even when you have no professional haskell experience yet. Pick up haskell by building real world applications.

Integrated Dev Tooling: To speed up your development process, IHP comes with a full set of web based dev tools. Including: a database schema designer, a web-based code generator, a web-based repl, ...

Major Operating Systems Supported: Windows (via Linux Subsystem), macOS, NixOS, Debian, Ubuntu

HSX: Like React's JSX. Write html code in your haskell files. This will be transformed to actual type-checked haskell code at compile time.

Auto Refresh: Re-render views in the background when the underlying data changes. This is useful when you want your views to always reflect the live database state. Auto Refresh can be an easy replacement for manually polling for changes using AJAX.

Here's a view using Auto Refresh, there's no app specific JS code here. All view updates are triggered by the server:

Auto Refresh

Auto Refresh can be enabled for IHP views with a single line of code.

Watch it in action!

Longterm Roadmap Lots of frameworks are already gone a year after launch. Especially in the fast moving JS world. But don't worry about IHP. We have been using it at digitally induced since 2017. It's actively used by us and our friends and partners. Even without external contributors we will build new features and do periodic maintenance releases in the future. We have big plans for IHP and as a profitable and independent software company we have the ability to actually execute them over the longterm.

Reviews

Here's what other people are saying about IHP:

<blockquote> IHP is the best web framework experience I have had. I think a lot of aspiring haskeller's will have worked their way through a text like Learn You a Haskell For Great Good or similar and then be looking to fool around with an actual project. IHP uses nix to cut out all the work of setting up ghc/stack/cabal which can be quite tricky for a beginner, it has just added haskell language server integration, it starts your postgres servers, it spares you from having to remember your SQL syntax, and means you can start writing haskell code instantly while getting immediate feedback on your hacking from GHCi and visually through the live reloading of the web app in your browser.

I've found the [hsx||] quasiquotes quite fun to work with and type safety has sped up development by preventing bugs that can easily crop up when you're linking forms to databases.

I like the design choices in IHP, and for me, at the moment, I like the focus on server side web app development, which encourages you to be more sparing/judicious in the use of javascript.

With IHP being opinionated about the models or views and routing it means I can focus on integrating some of the other really cool haskell libraries that exist into web apps. (I'm also trying to keep a log of my experiences here on an https://ihpcafe.ihpapp.com if you want to read along with someone figuring out function type signatures ;) )

</blockquote>

<a href="https://news.ycombinator.com/item?id=24817368">montmorency88 on HN</a>

<blockquote> I have been learning Haskell through IHP. It's the best and actually simplest web framework I have ever tried. The developer experience is the best I ever had for a MVC-style framework. And I got to learn Haskell without banging my head too much against the wall. Really enjoyed it :)

I really needed something like IHP to get started with Haskell. It's fun and easy and the documentation is very easy to follow.

I see some argue that they wish to make more custom choices regarding the setup. That is precisely what I don't want and that's why IHP is a great fit for me.

In terms of simplicity I think the choice of supporting only Nix and Postgres actually are strengths at this point. That lets them streamline the development of the framework without supporting the minor preferences of every individual. And these choices should work really well for most web developers.

Some may disagree on this, and maybe IHP is not for them, but I don't think it shouldn't discourage those who considers trying it out and form their own opinion.

I was prepared for great hardships learning Haskell as most of the resources are very academic and I'm mainly just a simple application builder. IHP was just what I needed to fill that gap, and it made it really fun :)

I am tweeting about the whole thing, coding Haskell for 100 days: https://twitter.com/larsparsfromage

</blockquote>

<a href="https://news.ycombinator.com/item?id=24829215">kodefant on HN</a>

<blockquote> IHP is supposed to become the Django/Rails/Phoenix of Haskell.

I’ve been using Django professionally for since 2013, but have started using IHP a couple of weeks ago. It’s still quite early but with surprisingly few rough edges, i.e. the developer ergonomics are much better than I expected. It has great documentation that is improving rapidly (as opposed to many other Haskell libraries, which provide little more than API docs or even just the typed function definitions) and offers a refreshing take on database management and migrations.

Some of its killer features:

HSX, a JSX-like template language that looks like HTML while providing type safety

Auto live reloading without the need to setup anything

Documentation with examples: it lets you query the database without learning about monads

it defines |> for you ;-)

type-safe, composable SQL queries

</blockquote>

<a href="https://lobste.rs/s/8pieht/ihp_modern_batteries_included_web#c_6lroyn">hendi on Lobsters</a>

There's more on the IHP website.

Getting Started

First: Watch the introduction video to see how it generally works

After that:

If you like videos, check out IHP Casts!.

You can also follow the written Guide to build your first project! 🚀

📧 To stay in the loop, subscribe to the IHP release emails. Or follow Follow digitally induced on Twitter

Install

See the documentation for installation instructions

Community

Questions, or need help with haskell type errors? Join our Slack Community

Also check out the IHP Forum!

Contributing

We are happy to merge your pull requests!😄

See CONTRIBUTING.md for more info.

Contributing Documentation

If you just want to improve docs, you can find the markdown files in the Guide directory.

Bounties

We use algora.io for bounties on IHP issues. Check out the open bounties below:

<a href="https://console.algora.io/org/digitallyinduced/bounties?status=open"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://console.algora.io/api/og/digitallyinduced/bounties.png?p=0&status=open&theme=dark"> <img alt="Bounties of digitallyinduced" src="https://console.algora.io/api/og/digitallyinduced/bounties.png?p=0&status=open&theme=light"> </picture> </a> <a href="https://console.algora.io/org/digitallyinduced/leaderboard"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://console.algora.io/api/og/digitallyinduced/leaderboard.png?p=0&theme=dark"> <img alt="Leaderboard of digitallyinduced" src="https://console.algora.io/api/og/digitallyinduced/leaderboard.png?p=0&theme=light"> </picture> </a>

Releases

You can find information on IHP releases in the GitHub releases section.

📧 Subscribe to the IHP release emails to stay in the loop.

Apple M1 Builds

Binaries for Apple M1 Builds are sponsored by MacStadium.

<img src="https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png" width="300px"/>

编辑推荐精选

蛙��蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI助手AI工具AI写作工具AI辅助写作蛙蛙写作学术助手办公助手营销助手
Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

聊天机器人AI助手热门AI工具AI对话
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

热门AI工具AI办公办公工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

模型训练热门AI工具内容创作智能问答AI开发讯飞星火大模型多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

AI助手热门AI工具AI创作AI辅助写作讯飞绘文内容运营个性化文章多平台分发
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多