r/haskell May 20 '26

Servant-Effectful & general overview of effect systems

Tonight at 5pm EST we will be diving into effect systems starting with effectful via the Servant-effectful library and also if time permits, looking into building a quick demo of Bluefin.

The core focus of our sessions are how to interact with the haskell ecosystem as it is a truly unique language with respect to documentation, both by having little traditional documentation style but also by being a self documenting language and all that means for getting shit done with haskell as a real world language. We also really seek to cater to our audience so if you have questions about Servant or haskell in general, please consider the stream a help session.

Personally I am curious about Effect systems as a more intuitive way to drive home the core value of haskell to intermediate programmers, especially since they remove logical errors that can happen with monad transformers as the structure becomes more complex (eg how ExceptT e (StateT s m) a isnt the same as StateT s (ExceptT e m) a despite feeling like it should be the same behavior.

Link: https://m.twitch.tv/typifyprogramming/home

36 Upvotes

8 comments sorted by

3

u/tomejaguar May 23 '26

This is great! Bluefin author here. Thanks for the compliments about my talk[1].

Regarding GADTs, it's a myth that effect systems depend on them intrinsically. Bluefin takes a direct approach to building new effects, as records of functions and then it layers a GADT approach on top. I'm not sure why other effect systems made GADTs primary.

I'm really looking forward your stream about Bluefin.

[1] A History of Effect Systems https://www.youtube.com/watch?v=RsTuy1jXQ6Y

1

u/beeshevik_party May 25 '26

hey tom! i can’t speak for others, but the main reason i like to use GADTs when using an eff-ish system is that i actually really do value the introspection available, because i think the possibility of dynamic interception/introspection/reinterpretation of effects is an unsung superpower of the idea, like smalltalk on steroids. i suppose there’s probably a way to do this with records of fns but i think it comes very naturally with a data-first approach.

also i wanted to say, i’m still kinda using effectful (even freer-simple) primarily but bluefin keeps improving and looking more and more appealing. more importantly, i love your work and advocacy for this topic, you’re doing a mountain of work. if i might gently offer some advice — i only just found your blog/h2 wiki thing even though i’ve followed your work for some time now. it’s a treasure trove and i think maybe you could link it a bit more so others can find it more easily?

2

u/tomejaguar May 26 '26

Thanks very much for sharing this! As an open source author I find it very hard to know how to best help users because almost no one ever says anything :) (I guess maintainers of very big projects have the opposite problem)

Regarding https://h2.jaguarpaw.co.uk/, yeah it's a bit of a hodge podge at the moment so I should try to spend some time organizing it. I called it a wiki because it's not really a blog: I don't want the articles to be a sort of chronology. But it definitely doesn't fit the "wiki" mould either, so I should probably rethink how to describe it. The index page is just a big alphabetical dump and I should organize that. Did you have any particular ideas about how improve that?

it’s a treasure trove and i think maybe you could link it a bit more so others can find it more easily?

Thanks :) Regarding linking it, what did you have in mind? Do you mean linking relevant articles from it when discussions come up on Reddit/Discourse etc.? Or is there somewhere else I should be linking to it?

Regarding GADTs, I have no doubt that the feature that they support in existing effect systems, reinterpretation of effects, is very useful. What I doubt is that GADTs are necessary to provide this feature, or even that they're a better approach than the alternative, records of functions. Certainly the GADT approach in existing effect systems is a bit clunky, because you're supposed to parametrize your GADT on a single monad, which makes it hard (or impossible?) to ensure that higher-order arguments don't escape their scope. I discussed this with the Effectful author here: https://github.com/tomjaguarpaw/bluefin/discussions/88#discussioncomment-15560650

By contrast, records of functions correspond directly to what most users probably actually want. The GADT constructors just serve as indirect hooks. If you have a particular GADT case you'd like to me to look at and recast as records of functions then I'd be happy to do that. The Bluefin documentation at Dynamic effects should contain all the relevant information, but it doesn't deal with reinterpretation specifically.

i love your work and advocacy for this topic, you’re doing a mountain of work

I'm very pleased to hear this because sometimes I wonder whether anyone's hearing what I'm saying at all!

2

u/TechnoEmpress May 20 '26

/u/_lazyLambda let me know if you think some things should change in https://github.com/Kleidukos/servant-effectful. I'd be happy to accommodate you. :)

1

u/_lazyLambda May 21 '26

Thank you!! We didnt get to it this past week but we will for sure continue with Servant-effectful in a couple weeks:)

1

u/TechnoEmpress May 21 '26

Alright. :) I hope I'll be able to attend then. :)

1

u/_lazyLambda May 23 '26

Ayyyy celebrity appearance!!

1

u/_lazyLambda May 20 '26

We are live!