# Iced-hs, a Haskell wrapper for iced

**URL:** <https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580>\
**Category:** Announcements\
**Created:** [March 9, 2025, 1:47am UTC](https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580 "2025-03-09T01:47:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![reki](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/reki/32/5023_2.png) [@reki](https://discourse.haskell.org/u/reki)\
**Post date:** [March 9, 2025, 1:47am UTC](https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580/1 "2025-03-09T01:47:15Z")

</div>

### Preface

I started working on this project around a year ago, so this is a late announcement. Since it has got some attention and @Kleidukos made it a proper cabal project, I came here to write a post.

> **[GitHub - ibaryshnikov/iced-hs: Haskell wrapper for iced](https://github.com/ibaryshnikov/iced-hs)**
>
> Haskell wrapper for iced

### About iced

It’s a modern ui library written in Rust. It’s built on top of wgpu and inspired by Elm. Find out more on the official page [https://iced.rs/](https://iced.rs/)

### Goals

- expose state of the art ui library to Haskell
- share Haskell syntax with Rust
- I wanted an excuse to write some Haskell

### Status

It’s quite incomplete, and the original iced is still marked as experimental. Despite of this, there’s a rich selection of examples so you can find out what is already possible.

### Platform support

Original iced is a crossplatform library, mainly targeting desktops. But it doesn’t prevent you from building for other platforms. For example, I had some luck with building Android apps with it. And it was proven to work for iOS either.

Coming back to Haskell, iced-hs currently works on Linux and hopefully on macOS (I haven’t had a chance to test that yet since I mostly work on a Linux PC, but help with testing is welcome here). Sadly, build on Windows is quite broken because I was unable to find a way to link Haskell with Rust there.

In general, if you find a way to link Haskell with Rust on a particular platform and original iced works there, this wrapper will work either.

### Call for testing and feedback

I’ll be happy to hear any feedback about the usage of this wrapper. If there’s a bug or a feature you would like to see, please open an issue. I’ll be interested to hear about different use cases too.

### A few words about my contribution

Since it’s a wrapper to an existing library, I’m mostly working on writing FFI and designing user-facing api.

I’d like to highlight a few Haskell features which I absolutely love:

- `StablePtr`
- `foreign import ccall "wrapper"` and `FunPtr`
- `ForeignPtr`

I can’t imagine writing such a library without these. FFI in Haskel is one of the best I’ve ever seen and I feel like I have everything I need.

When it comes to api design, there’s a number of great projects around. All what’s needed is to study them and to put the best parts together.

---

<div class="post-metadata">

**Author:** ![hasufell](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/hasufell/32/1250_2.png) [@hasufell](https://discourse.haskell.org/u/hasufell)\
**Post date:** [March 9, 2025, 12:04pm UTC](https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580/2 "2025-03-09T12:04:42Z")

</div>

Does this depend on any system libraries or can you build a fully static binary with this toolkit?

---

<div class="post-metadata">

**Author:** ![Swordlash](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/swordlash/32/4604_2.png) [@Swordlash](https://discourse.haskell.org/u/Swordlash)\
**Post date:** [March 9, 2025, 1:58pm UTC](https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580/3 "2025-03-09T13:58:07Z")

</div>

Woah that is awesome. And the styling!

---

<div class="post-metadata">

**Author:** ![reki](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/reki/32/5023_2.png) [@reki](https://discourse.haskell.org/u/reki)\
**Post date:** [March 9, 2025, 11:52pm UTC](https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580/4 "2025-03-09T23:52:51Z")

</div>

It produces a static binary with no dependencies.

---

<div class="post-metadata">

**Author:** ![Voyd](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/voyd/32/3143_2.png) [@Voyd](https://discourse.haskell.org/u/Voyd)\
**Post date:** [March 10, 2025, 1:15pm UTC](https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580/5 "2025-03-10T13:15:28Z")

</div>

I was just looking for something like this the other day, thank you!

---

<div class="post-metadata">

**Author:** ![reki](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/reki/32/5023_2.png) [@reki](https://discourse.haskell.org/u/reki)\
**Post date:** [March 11, 2025, 12:27am UTC](https://discourse.haskell.org/t/iced-hs-a-haskell-wrapper-for-iced/11580/6 "2025-03-11T00:27:17Z")

</div>

I hope it works well for your use case!
