r/haskell • • 5h ago

datomlite - A zero-dep, Datomic-style "DB-as-a-value" you can drop into your Haskell apps... (Looking for feedback!)

10 Upvotes

Hello! Been tinkering on datomlite for a while, and it should be about ready for trials ... would love your sharp eyes on how the "typed datalog-style" API feels and if you see any glaring performance weak seams.


r/haskell • • 7h ago

Community suggestion on Prelude replacement

11 Upvotes

I am trying to weigh options on if a Prelude replacement is needed and if so, which one.?

I see a lot prelude replacements are naintained by small companies or one or two person shops. And some preludes like classy prleude are dead and obsolete?

What is preventing the GHC maintainers from adopting the learnings from the prelude replacements? I understand backward compatibility is a big concern, but new improved functions and types cn be added to new modules and re exported?​​​


r/haskell • • 7h ago

In this approach, `StateT` modules are treated as independent functional units, which are then composed to build business applications. This method utilizes `liftIO` to vertically integrate `IO` action functions, serving as an alternative to the commonly used `ReaderT` pattern.

0 Upvotes

I watched the following video, which discusses the issue of "Transformer Hell" (the complexity arising from nested monad transformers) and proposes the use of "Algebraic Effects" as a solution:

https://www.youtube.com/watch?v=P3FmKp4HtSo

Intrigued, I experimented with the Haskell library `Polysemy`, but it did not provide the level of flexibility I had hoped for.

Since the core of functional programming lies in function composition, I began to wonder if the practice of composing monad transformers might actually undermine modularity.

Consequently, I propose a design in which `StateT` modules—built upon `IO`—are layered atop a `main` function that is also rooted in `IO`. This approach should help prevent structural complexity, even in large-scale programs. Furthermore, by standardizing the implementation patterns across modules, one can expect improvements in productivity, safety, and reusability.

With the assistance of Google Gemini and ChatGPT (for tasks such as debugging compilation errors), I developed and executed test code. When I asked both AIs to evaluate the design philosophy and the actual code, they concluded that "this design approach could serve as a highly viable architectural option for building enterprise-grade Haskell applications." I am sharing this in the hope that it might be useful to others.

As the full codebase is quite extensive, I have included only the parts related to `StateT` here. Please note that my previous post was removed for violating the terms of service due to the inclusion of AI-generated content. I would like to take this opportunity to offer my sincere apologies to Axman6 and 1rs, who left comments on that post.

Since 1rs expressed interest in the code, I have attached the section where `StateT` is implemented. Please note that this is an excerpt, as the full text is too long to include here.

■ IOEitherTest.hs

{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DuplicateRecordFields      #-}
{-# LANGUAGE OverloadedRecordDot        #-}

import Control.Monad
import Control.Monad.State.Strict
import Control.Monad.Except
import Data.Either
import Data.Decimal
import Data.Time
import Types.MessageType
import Types.MoneyType
import Types.CustomerType
import Types.ProductType
import Types.SellType
import Text.Show.Unicode

-- ==========   売上情報生成関数   ========== --

type MainPara = (CustId,[(ProdId, Quantity)])
type SellPara =          (ProdId, Quantity)
type SldtPara = (SldtNo,  ProdId, Quantity)
type RsSell   = Either ErrMsg Sell
type RsSldt   = Either ErrMsg Selldtl
type StSell   = StateT [ Sell ] IO ErrMsg
type StSldt   = StateT [RsSldt] IO ErrMsg

-- 売上明細の作成と明細一覧への追加
makeSells :: [MainPara] -> StateT [Sell] IO ErrMsg
makeSells sellparas = do
    sellList <- get
    (emsg, newList) <- liftIO $ flip runStateT sellList $ 
        forM sellparas $ \(cid, dtls) -> addSell cid dtls
    put  newList
    pure $ fmtErrMsg $ foldr (<>) (ErrMsg "") emsg

-- 売上伝票の作成と売上一覧への追加
addSell :: CustId -> [SellPara] -> StSell
addSell cid dtls = do
    let addSldtNo :: SldtNo -> SellPara -> SldtPara
        addSldtNo sldtno (prodid, quantity) =
                 (sldtno, prodid, quantity)
        dtails  = zipWith addSldtNo [firstSldtNo ..] dtls
    sellList    <- get
    slno        <- pure   $ getSellNo sellList
    now         <- liftIO $ getCurrentTime
    customer    <- liftIO $ getCustomer cid
    (emsg, dts) <- liftIO $ (`runStateT` [])
                            (addSelldtl slno dtails)
    let sell = mkSell slno  (utctDay now) (rights dts) customer
    case sell of
        Left  ermsg -> pure (ermsg <> emsg)
        Right rsell -> do
            put (sellList <> [rsell])
            pure emsg

-- 売上明細の作成と明細一覧への追加
addSelldtl :: SellNo -> [SldtPara] -> StSldt
addSelldtl slno dtls = do
    detail <- liftIO $ forM dtls $
        \(sldtno, prodid, quantity) -> do
            product <- getProduct prodid
            pure $ mkSelldtl slno sldtno quantity product
    put  detail
    pure $ foldr (<>) (ErrMsg "") (lefts detail)

-- ==========   試験用アクション   ========== --

main :: IO ()
main = do
    let sellList = [] :: [Sell]
        keyEnt = [((CustId 1),[((ProdId 1),(Quantity  5))
                              ,((ProdId 2),(Quantity 10))
                              ])
                 ,((CustId 2),[((ProdId 2),(Quantity 10))
                              ,((ProdId 3),(Quantity  1))
                              ])
                 ,((CustId 3),[((ProdId 1),(Quantity  5))
                              ,((ProdId 3),(Quantity  1))
                              ])
                 ,((CustId 1),[])
                 ,((CustId 4),[((ProdId 2),(Quantity 10))
                              ,((ProdId 3),(Quantity  1))
                              ])
                 ]
    (errs, slist) <- (`runStateT` sellList) (makeSells keyEnt)
    uprint errs
    uprint slist

-- λ>main
-- ErrMsg "CustNm \"IBM\" Selldtl's cont is 0. ||
--         Customer not found: CustId 4"
-- [ Sell { sellNo = SellNo 1
--        , sellDt = SellDt 2026-11-16
--        , custId = CustId 1
--        , custNm = CustNm "IBM"
--        , ttlAmt = TtlAmount 170
--        , taxRt = TaxRate 10
--        , taxAmt = TaxAmount 17
--        , allAmt = AllAmount 187
--        , selDtl = [ Selldtl { sellNo = SellNo 1
--                             , sldtNo = SldtNo 1
--                             , prodId = ProdId 1
--                             , prodNm = ProdNm "pencil"
--                             , prodPr = Price 30
--                             , sldtQt = Quantity 5
--                             , amount = Amount 150
--                             }
--                   , Selldtl { sellNo = SellNo 1
--                             , sldtNo = SldtNo 2
--                             , prodId = ProdId 2
--                             , prodNm = ProdNm "Paper"
--                             , prodPr = Price 2
--                             , sldtQt = Quantity 10
--                             , amount = Amount 20
--                             }
--                    ]
--        }
-- , Sell { sellNo = SellNo 2
--        , sellDt = SellDt 2026-11-16
--        , custId = CustId 2
--        , custNm = CustNm "Apple"
--        , ttlAmt = TtlAmount 120
--        , taxRt = TaxRate 10
--        , taxAmt = TaxAmount 12
--        , allAmt = AllAmount 132
--        , selDtl = [ Selldtl { sellNo = SellNo 2
--                             , sldtNo = SldtNo 1
--                             , prodId = ProdId 2
--                             , prodNm = ProdNm "Paper"
--                             , prodPr = Price 2
--                             , sldtQt = Quantity 10
--                             , amount = Amount 20
--                             }
--                   , Selldtl { sellNo = SellNo 2
--                             , sldtNo = SldtNo 2
--                             , prodId = ProdId 3
--                             , prodNm = ProdNm "eraser"
--                              , prodPr = Price 100
--                             , sldtQt = Quantity 1
--                             , amount = Amount 100
--                             }
--                   ]
--        }
-- , Sell { sellNo = SellNo 3
--        , sellDt = SellDt 2026-11-16
--        , custId = CustId 3
--        , custNm = CustNm "Fujitsu"
--        , ttlAmt = TtlAmount 250
--        , taxRt = TaxRate 10
--        , taxAmt = TaxAmount 25
--        , allAmt = AllAmount 275
--        , selDtl = [ Selldtl { sellNo = SellNo 3
--                             , sldtNo = SldtNo 1
--                             , prodId = ProdId 1
--                             , prodNm = ProdNm "pencil"
--                             , prodPr = Price 30
--                             , sldtQt = Quantity 5
--                             , amount = Amount 150
--                             }
--                   , Selldtl { sellNo = SellNo 3
--                             , sldtNo = SldtNo 2
--                             , prodId = ProdId 3
--                             , prodNm = ProdNm "eraser"
--                             , prodPr = Price 100
--                             , sldtQt = Quantity 1
--                             , amount = Amount 100
--                             }
--                   ]
--        }
-- ]

r/haskell • • 15h ago

A B compiler written in Haskell. Looking for code reviews.

15 Upvotes

This is my first ever compiler (Maybe second if I wanna consider that semi-serious assignment in Uni on a C compiler) and also my first major project with Haskell. Before this, I mainly did Hackerrank and a couple of advent of code with Haskell.

The Lexer, Parser and semantic analyser/IRGen is written in Haskell, and it targets the QBE backend.

Repo - https://github.com/SBaori/B

Looking for feedback and code reviews on good practices missed, some idiomatic patterns in compiler development and general Haskell coding standards advice.

Comment on LLMs - Every single character in the repo is thought, reasoned and written by me. LLMs were only used for summarising the original B specification, learning some compiler theory and trying to extract/query some built-in functions from Haskell.


r/haskell • • 1d ago

How do you get stack to output a shared library in the project root directory.

4 Upvotes

I'm trying to write a haskell library that will be called up by a lisp script. So far I think I've gotten it to compile to a shared library (I think) but I don't know how to get it to save the shared object to where I want it. I tried using the -o option in ghc-options for the library in package.yaml but then it complains that there's no Main module.


r/haskell • • 1d ago

IDE development for a language/compiler written in Haskell

22 Upvotes

Hello everyone. So I am doing my undergraduate thesis and I have made a langauge. After our first graded defense, the panels recommended that I build an IDE. Reason because for non technical people (including CS people who's not familiar with PL) it's the best way for them to understand and appreciate the thesis. I am yet to do my research on IDE development. I already have the impression that I will create an LSP. I am wondering if there's a documented and easy but stable way of building an IDE using Haskell as well (since my compiler is in Haskell already maybe it will make it easier). I'm curious to hear opinions on people who have done this already. Thanks.


r/haskell • • 2d ago

blog Cross-compiling Haskell: running Template Haskell on the build machine

27 Upvotes

Cross-compiling a Haskell library becomes more complicated when compiling it also means executing Haskell. A small deriveJSON splice can turn an otherwise ordinary cross build into a job that needs a target interpreter, an emulator, or access to a device.

The experiment in template-haskell-cross explores another arrangement: execute Template Haskell with a native compiler on the build machine, then pass its results to the cross compiler. The implementation combines a GHC plugin, a native worker process, a binary protocol, and Nix helpers. It has been used to build a Haskell library with generated FFI exports for an Android application.

This article follows that experiment: why the usual execution model makes cross builds difficult, how the alternative works, what broke along the way, and which parts could inform GHC itself.

https://serokell.io/blog/cross-compiling-haskell-with-template-haskell


r/haskell • • 2d ago

announcement Haskell Interlude #89: Trevis Elser

Thumbnail haskell.foundation
24 Upvotes

Matti and Farhad are joined by Trevis Elser, chairman of the Stability Working Group, to talk about the working group, Haskell in industry, and what we can learn from senior Java engineers!


r/haskell • • 2d ago

Your experience with LLM generated code (so I can sanity-check mine)

9 Upvotes

Hey all,

my first post here. Hope title clearly states its in good faith - I don't have solidified opinion, but the general public makes me feel gaslit so I am turning to you to help me realize where (and possibly if) am I wrong.

Context:
I have been software engineering for about 30 years now, and Haskell is my primary language for about 16. I'm reasonably confident with its edge features too - kinds, dependent types, type families and I've spent quite some time toying with linear types too.

The meat of the post:
so, I've attempted to use three different publicly available LLMs (CGPT, Grok and Gemini) to resolve a problem when I'd encounter that type of issue, where I am convinced my solution will work but puzzlingly, it doesn't. Those errors that depend on my misunderstanding of the problem - and consequentially the solution, not necessarily misunderstanding of my code.

My experience is universally such, that when asking an LLM to generate code for me - it would lead me down a wild goose chase. In about 15-20% of cases it would provide code that wouldn't even compile; in other cases, it requests changing type signatures - even when given all insight about types involved. In other cases it solves immediate problem at hand, but since I don't fully understand its code - and its explanation doesn't entirely encompass all the subtle edge cases - I end up with code that misbehaves only sometimes. Most of the time - it wants to modify entire codebase, foundational types, interactions between these types - and it wants to modify it in the way that practically nullifies the use of those types (such as requiring pattern matching of types that need to remain opaque).

I've observed this behaviour across multiple types of projects and even different languages; at one point I was trying to enroll its help to bind Rust ONNX library to a Haskell project, and it led me down two hours or wrong pathways. If I trusted my instinct in the beginning and doubled-down on it - it would've take me 10-15 minutes to find and fix the issue myself.

So far, the most useful workflow for me has been to forbid an LLM to generate any code - including pseudo code - and ask it to just analyze the problem and present me with a solution in form of a text so that I understand it better. This sometimes leads to a short conversation where I polish out questionable assumptions and then I have a working solution that is, more or less, 10-15 minutes to implement.

Some of my acquaintances and colleagues (not necessarily Haskell developers) said that they get the best results when they don't ask an LLM to solve only a small piece of a problem, but present it with the entire point of the project and let it develop everything and then iterate slowly over the wonky pieces, perhaps rewriting few by hand.

Not only that this is the opposite of my workflow, where I set up the architecture myself and try to employ LLM to solve small bits - it is also concerning to just run and keep a large body of code that I don't really understand. I don't do this with software written by humans either and will normally audit the developers, the company and/or the code itself.

After reading all this - would you care to share your experiences with 'vibe-coding' if you use it, and what kind of workflows work for you? I am getting increasingly concerned, over the past year, that I am "falling out" from technology because I don't know how to properly employ it, and I think this is affecting my ability to get work.

Thank you.


r/haskell • • 2d ago

announcement Announcing Prospero: a strongly-typed configuration language with Haskell-like syntax

26 Upvotes

I'm announcing Prospero - a new configuration language with Haskell-like syntax that currently evaluates to JSON or YAML.

For a good few years now, I've been investigating the space of configuration languages like Dhall and Nickel. If you have to write complex configuration when working with the likes of terraform or kubernetes, these kinds of languages can drastically reduce the amount of complexity you're confronted with and the volume of repetitive code you have to maintain. Despite their perfect fit for the problem space, I've never been entirely happy with any of the language options already available: I've been hungry for more type system features and the powerful type inference that languages like Haskell have treated us to.

Late last year, I completed a major infrastructure as code project in Pulumi. It offers another arguably compelling solution to a similar problem: generate configuration in a mainstream programming language. I've encountered similar ideas from time to time: Scala's sbt is another one I've used a fair bit that does something similar, letting you write your project's build configuration in Scala.

These kinds of approaches are extremely powerful but they come at a tremendous cost in both the amount and the types of complexity you have to deal with in configuration. In my opinion, being able to write arbitrary side effects and arbitrary non-terminating code in configuration isn't a feature, it's a category error.

So, I decided to try and build a language that meets all of my needs more precisely.

Prospero has a type system that features:

  • Powerful type inference
  • Parametric (including higher-kinded) polymorphism
  • Structural record types
  • Algebraic data types (ADTs) + pattern matching
  • Type classes (including multi-parameter type classes)
  • Unit of measure (Kennedy)
  • Rank-N types
  • Pure functions only (no side effects allowed)
  • Only structural recursion (without manual church-encoding)

Here is a little taster:

example.ppo

measure MiB
measure GiB = <1024 MiB>

data Service = Service
  { name : String
  , memory : Integer<MiB>
  , replicas : Int
  }

memoryFootprint : [Service] -> Integer<MiB>
memoryFootprint s = sum <| map (\x -> x.memory * x.replicas) s

let services =
  [ Service
      { name = "api"
      , memory = 512<MiB>
      , replicas = 3
      }
  , Service
      { name = "postgres"
      , memory = 2<GiB>
      , replicas = 1
      }
  ]

toString <| memoryFootprint services

Running prospero evaluate --to-json example.ppo prints:

"3584 MiB"

Structural recursion

data Nat
  = Zero
  | Succ Nat

toInt : Nat -> Int
toInt n = case n of
  Zero   -> 0
  Succ m -> 1 + toInt m

toInt (Succ (Succ (Succ (Succ Zero))))

Prospero accepts the above and it evaluates to 4.

If you instead wrote (using n instead of m)...

toInt : Nat -> Int
toInt n = case n of
  Zero   -> 0
  Succ m -> 1 + toInt n

...you would see elaboration error: \toInt` is recursive, but no argument gets structurally smaller on every recursive call`

Prospero is currently an early prototype. I'm sharing it mostly to find out if people are interested and what features I should spend time on next. If you're looking for a mature and production-proven configuration language, I recommend Dhall.

At this stage, please do not expect:

  • A language server
  • Error messages with useful source metadata
  • Any kind of polished or pleasant user experience

On the other hand, you might see:

  • Parser bugs
  • Compiler bugs/crashes
  • Breaking changes in language syntax
  • Termination checker escapes
  • Weird performance characteristics

Here are some things I'm thinking about adding in the future:

  • Source annotations + language server
  • Dhall-style semantic hashing
  • Remote (URL) imports
  • More compilation targets, e.g. TOML, Nix, etc.
  • Expanded prelude with more built-in type classes
  • Idiom brackets (syntactic sugar over Applicative)

Thoughts, ideas and contributions are all very much welcome. Prospero is written entirely in Haskell.

Try Prospero


r/haskell • • 3d ago Heartwarming Mindblown

announcement Mischief - The Haskell Game Engine. Now with Rendering, Assets, Input.

102 Upvotes

Hey. so I just published all my work on Mischief on Hackage. It's a free, open-source, ECS Game Engine written in Haskell that I've been working continuously on for the past 6+ months.

It is a modular, decentralized, customizable game engine that leverages functional programming and data-oriented design to create a fresh experience for game devs. It prioritizes making weird, unique, personal games with a strong focus on creativity and human expression. The engine itself is also what I'd consider to be one of my greatest artistic feats and acts of creation. You can find more about the community and engine's values here.

On top of the ECS (which I've previously posted about but almost entirely reworked since), it now has input support (via SDL) and hot-reloadable assets.

It also has a strongly-typed rendering abstraction that I've built on top of WGPU. It allows you to define extendable shaders / materials directly in Haskell and integrate them into the your app pretty easily. You can easily write low-level rendering code without the usual layers of boilerplate surrounding it. Note that you could also just use the pre-defined materials (such as the sprite material) and skip past the low-level stuff, it's up to you.

There's a lot of cool utilities and tooling that's documented in the official books (link below), so I really encourage anyone interested to give it a try and at least go through the introductory chapters. I consider it to be a pretty unique and creative spin on a lot of the game engines we've seen over the years in other languages. Each little thing is meant to be "what if you had something as good as X from engine Y, but it was entirely functional?".

You don't really need any previous Haskell, ECS or game dev experience to use it. The books will slowly ease you into it.

You can read more details and catch up on the official docs here.

I also encourage you to join the official discord community server if you are at all interested in the engine or just seeing and discussing cool apps written in Haskell, or chatting with people passionate about it, or just supporting me and Mischief.

As a side note, no "generative AI" such as LLMs was used in making this and I plan to keep it that way (see the "AI" policy). Discussion of "AI" is also greatly discouraged on the official community places. I am burnt out on the subject and want to create a small safe haven for people that are as well.

Additionally, the official repo can be found here (I moved it to Codeberg recently). Don't hesitate to request features, file bug reports, or contribute in some other way.

Also, here's a video of a little example where I spawn a few sprites, move them around, and mess with their animations live (sorry for the bad framerate / quality, I had to make it a gif):


r/haskell • • 4d ago

Vibe yourself a better ghcid

0 Upvotes

ghcid is a tool for getting fast type checker feedback when writing Haskell programs. I vibe coded new features to ghcid which make it much better for use by a coding agent. I can’t share the code, unfortunately, because my workplace’s open source release process is too bureaucratic to make that worthwhile. I can, however, describe what those features are, in case any one else wants to vibe or hand code their own equivalent, and maybe share the result with us all!


r/haskell • • 5d ago

announcement A technical vision for the Haskell ecosystem - Haskell Foundation

Thumbnail discourse.haskell.org
85 Upvotes

r/haskell • • 6d ago

announcement Fund the Products, Not the Foundation

69 Upvotes

Hi everyone,

I'm Arseniy, CEO of Serokell.

I recently accepted an invitation to join the Haskell Foundation Board. For most of the last decade, I’ve been trying to make Haskell work commercially: finding projects where it makes sense, convincing companies to try it, and hiring people to write it.

After watching where adoption gets stuck, I’ve written down some thoughts on how we can better align commercial funding with actual ecosystem needs: https://serokell.io/blog/funding-haskell-upstream.

Here are the main points I wanted to discuss:

- Product-based funding: Companies struggle to justify broad, undefined donations to the Foundation. Funding needs to be tied to concrete “products” with clear owners and KPIs (e.g., improving build times, maintaining core tooling, production documentation).

- Lessons from other ecosystems: Looking at successful models like the Rust Foundation’s Commercial Network and the Sovereign Tech Fund’s investments in Cabal.

- A first experiment: Proposing to start with an objective, public benchmark of Haskell build performance before asking companies for financial or engineering commitments.

- Conflicts & transparency: How commercial players (including Serokell) can participate in Foundation work while keeping the process simple and transparent.

I’m sharing this in my personal capacity to get a conversation going. I’d love to hear your thoughts, feedback, and ideas from the community!


r/haskell • • 7d ago

London Haskell Meetup - November

33 Upvotes

Calling all Londoners (and people who can get to London)!

On Thursday 26th of November, we will be running a Haskell talk at Imperial College London. Doors open at 18:30, the talk starts at 19:00

If you're interested, sign up to the event!

There are more details on the event page

If you're interested in submitting a talk for a future event, please use the form. If you have any questions, please email us at london.haskell.meetup [AT] gmail.com.

Join us on Discord: https://discord.gg/e7X9PKuha

This month's event is sponsored by Obsidian Systems.

The Talk

Haskell: Origins, Evolution, and Future by Simon Peyton Jones

Haskell is an unusual survivor in the Darwinian landscape of programming languages: it is long-lived (36 years old), yet not mainstream; it is both a research platform and a production tool; it pushes the boundaries of what you can do with static types; and (anecdotally) it inspires joy as well as offering utility.

In this talk I'll describe how Haskell came to be, and what (in retrospect) I think are its most important contributions. I'll talk about how it has evolved, especially in response to the demands of companies using Haskell in production.


r/haskell • • 9d ago

[ann] base32-1.0

27 Upvotes

Hey all,

The last of the bunch is up: simd support, faster api, lots of good happy changes that homogenize `base32` with the `base16` and `base64` apis and gets its performance on par with the best out there. Go haskell!

Check it out here: https://hackage.haskell.org/package/base32-1.0


r/haskell • • 9d ago

announcement New Relase of Swiss Army Knife

Thumbnail github.com
12 Upvotes

Version 1.2.0.0

New feature added: Gitit

Allows you to create remote repos on GitHub, GitLab, and Bitbucket, also optionally setting up the remote in your local project.

Documentation has been updated and improved.

Available on both Hackage and the AUR.


r/haskell • • 9d ago

[ANN] hmssql: Pure Haskell SQL Server client (mostly AI-coded)

0 Upvotes

I'm happy to announce the initial release of hmssql, a SQL Server client library for Haskell. This implements SQL Server's binary protocol natively (TDS 7.4 / 8.0), so it does not require an ODBC driver or client library.

This is based on mssql-simple by Mitsuji, Takamasa, and hpgsql by Marcelo Zabani. I used AI to port mssql-simple to hpgsql's streaming design, build out support for the newer TDS 7.4 and 8.0 protocols, and spent about two months using AI to test/optimize/refine it.

** Important **

  • hmssql, including its documentation, is almost entirely AI-generated. (This Reddit post is written by me, however.)
  • hmssql is not on Hackage yet. I would like to receive feedback before uploading it.

Features

  • Streaming results, including support for streaming large values
  • MARS (Multiple Active Result Sets), which is useful for streaming the results of multiple queries together (e.g. parents with their children)
  • Well-tested query cancellation
  • Works on Windows

Edit: Unlike hpgsql, I chose not to include a quasiquoter, to avoid dragging in ghc or ghc-lib-parser as a dependency. However, it should be possible to implement in a separate library.


r/haskell • • 10d ago

question FSK modulator in Haskell coming from imperative programmer

19 Upvotes

I'm coming from a background in imperative programming and interested in learning some functional programming. Generally my interests are in signal processing and I learn best by making something.

I ported this small FSK modulator and tried to keep a Haskell/Functional spirit about it:

https://github.com/dspta2020/haskell-signals/blob/main/tooling/fskMod.hs

So far I feel like the Haskell design paradigm (from what I have read and watched) is to express code in terms of transformations (functions) that map some input to some output. Then say I need to process my data through a series of transformations, I compose those to make a single function acting as processing pipeline.

Obviously the main is setup like a script and not destined for some larger framework.

But I feel still feel like I'm doing imperative programming just with nested functions. Am I way off here? I could see how in some scenarios the deferred computations with the lazy evaluation could be efficient. But besides that what is the advantage to the function composition design patterns? I feel like the compiler optimizations are doing alot of heavy lifting.

Any feedback is welcome.

Mods, apologize if this violates a rule, its obviously not computer-generated nor homework.


r/haskell • • 11d ago

announcement [ANN] wasmedge-hs: Type-safe Haskell bindings for WasmEdge runtime (v0.18.1)

8 Upvotes

Hello Haskellers,

I just released wasmedge-hs on Hackage - a modern, type-safe FFI binding for the WasmEdge WebAssembly runtime (supporting WasmEdge 0.18.1).

Highlights:

  • Safe FFI & Resource Management: Phantom-typed ownership (OwnedCtx vs BorrowedCtx) and bracket-style lifecycles prevent double-frees and use-after-free bugs.

  • Type-level Host Functions: Expose typed Haskell callbacks directly to WASM without manual WasmVal unpacking:

    builderAddHostFunc builder "add" $ \(x :: Int32) (y :: Int32) -> 
      pure (x + y) :: IO Int32
    
  • Linear Memory & Complex Types: Built-in typeclasses (WasmMemory, WasmJSON) and liftMemFunc for seamless memory marshalling.

  • Full Coverage: WASI, LLVM AOT compilation (.wasm → .so/.dylib), async execution, plugin discovery, and exception handling tags.

Quick snippet:

{-# LANGUAGE OverloadedStrings #-}
import WasmEdge.VM
import WasmEdge.Types

main :: IO ()
main = withVM Nothing Nothing $ \vm -> do
  res <- runWasmBytes vm wasmBytecode "add" [WasmI32 40, WasmI32 2]
  print res -- Right [WasmI32 42]

Feedback and contributions are welcome!


r/haskell • • 11d ago

Is the GHC breakage inventory useful to anyone?

Thumbnail discourse.haskell.org
12 Upvotes

r/haskell • • 11d ago

Does anyone want to take over maintenance of the Kowainik ecosystem?

33 Upvotes

I've been maintaining parts of the Kowainik ecosystem for the last three years but I'm stopping doing so effective immediately. For more details see:


r/haskell • • 12d ago

announcement Haskell Ecosystem Packages now offered by MLabs

33 Upvotes

Hi all,

MLabs is partnering with the Haskell Foundation to offer ecosystem packages, as part of our ecosystem partnership program.
Contracting MLabs via one of these packages results in direct contributions to both the Haskell ecosystem, and the Haskell Foundation.

Thanks MLabs!

https://haskell.foundation/partnerships/mlabs.html


r/haskell • • 13d ago

announcement Fully-Funded PhD Studentships at the University of Nottingham, UK

Thumbnail people.cs.nott.ac.uk
30 Upvotes

Interested in a PhD studentship in the Functional Programming Lab in Nottingham? Fully-funded studentships are currently being advertised; deadline 6 January 2027. Please share, and encourage excellent students to apply!  https://people.cs.nott.ac.uk/pszgmh/phd-advert.html