XIO

xWire

Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.

Haskell Community - Latest posts

Latest posts

Cabal progress bar for building packages, libraries

Here’s the implementation: Codeberg.org cabal-progress-bar cabal-progress-bar What now needs to be done is connecting it to cabal and let cabal get the events (first/next module compilation started, component completely compiled). REQUEST FOR CONTRIBUTIONS! => Adding loading indicators to the build command · Issue #8943 · haskell/cabal · GitHub

How to refactor this code combining IO and Either?

dfilaretti: Yep, interesting… so according to the author what has been suggested before (and I ended up implementing) is an anti pattern. I don’t agree with Snoyman’s article. Some parts of it I agree with, but over all I don’t think it does a good job of charting a way forward. Let’s have a look through it. A common (bad) design pattern I see is something like the following: myFunction :: String -> ExceptT MyException IO Int There are (at least) three problems with this: It’s non-composable .…

Haskell app for building DJ sets/playlists and providing "next track" recommendation

Hi all, during the last couple of months I’ve been working on a little music-related Haskell program. I thought I’d share it here in case anybody else finds it interesting or want to provide feedback. This blog post explains the underlying ideas and motivations in detail, and the code is available here.

State of Haskell 2026 Survey

Dear community, the Haskell Foundation is continuing the tradition of a yearly State of Haskell survey, with the 2026 edition. We hope you’ll take some time (~10 minutes) to tell us about how you use Haskell, so we can better understand and serve the community surveymonkey.com State of Haskell 2026 Take this survey powered by surveymonkey.com. Create your own surveys for free. Please share with people you know! The more responses we get, the better we can plan. The survey will close on November…

`hs-bindgen` playground

Sorry about that, and thanks a lot for reporting. It should work now, I managed to create bindings for your header just now! Details about the bug: The `hs-bindgen` playground had `LANG` unset. hs-bindgen uses libclang to process the header, which uses UTF-8 by default. However, it also runs clang -E when reparsing some declarations to interpret macro invocations. This invocation of clang -E failed when the header contained non-ascii letters, and no LANG was set. In addition, the failure was…

Output Existentials

Wow! So many good questions! Furthermore, maximum needs Ord. How to push that inside MkE? Or might maximumE just fail at runtime? You are right - we cannot guarantee, that MkE has a type which is bounded by Ord! That’s why such code maximum . unE fails during a compile time! Yes, we need to push boundaries inside the data first and transitively preserve them: data E' = forall a. Ord a => MkE' [a] unE' :: E' -> exists a. Ord a => [a] unE' (MkE' @e xs) = therefore @e in xs Or must I create a…

Output Existentials

VitWW: lengthE (MkE @e xs) = L.length @e xs length nowadays has two type params, so that code is wrong. How are you going to express the needed typing for therefore? In any case, length is a poor example because it doesn’t care about the element type. Instead, consider: maximum :: (Foldable t, Ord e) => t e -> e So with maximum . unE, unE’s output existential is to be maximum’s input and its output. Does this mean maximum must output an existential? How does that work? Or must I create a…

Call for applications to the haskell.org working group

The Haskell.Org Committee has agreed to transfer the authority over www.haskell.org over to the Haskell Foundation The Haskell Foundation is therefore putting a new working group in place to manage www.haskell.org, both in terms of content but also all the machinery that builds and serves it. If you have opinions about what the Haskell community’s front page should look like, you’re in luck! We are currently looking for volunteers. Interested parties are invited to send me an e-mail explaining…

Stack outputs executable in source directory?

Personally, I would not classify it as a ‘bug’, in the sense that Cabal (the library) and GHC are behaving as expected and documented (even if that behaviour may be unintuitive). However, the fact that you were caught out by it motives me to think how Stack’s documentation might be updated. EDIT: I’ve added a question about “Must package components have distinct source file directories?” to 2. Package description - Stack

`hs-bindgen` playground

That’s really cool ! However, I tried to generate the bindings for this library : link/extensions/abl_link/include/abl_link.h at master · Ableton/link · GitHub But nothing happens. I have to say I know nothing about Haskell FFI, so I have no idea what I’m doing, but I would expect some error message to give a hint of what went wrong ?

Purpose of Network.Wai.ResponseReceived

jaror: Even if GHC would allow defining the type synonym, most uses of it would be a higher rank type. For example, Application -> Foo would then expand to (forall r. Request -> (Response -> IO r) -> IO r) -> Foo which is a higher rank type. Technically, types like Foo -> Application are not really higher rank because the quantifier appears only to the right of the function arrow, but GHC rejects these anyway probably because of historical reasons mentioned in point 1. That does explain my…

Purpose of Network.Wai.ResponseReceived

Thank, that was a kind of Freudian slip because I think newtypes are the best solution to deal with these cases. You can define a newtype with a forall in it: newtype Application = MkApplication { serve :: forall a. Request -> (Response -> IO a) -> IO a } This has much fewer issues with type inference and type checking in my experience. The cost is that you now need to wrap and unwrap this newtype, but ideally you’d hide that under a nice clean API.