XIO

xWire

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

Haskell Community - Latest posts

Latest posts

Totality-checking for Haskell?

Is there an established definition of totality, and does it entail termination? Notably, is id :: Void -> Void a total function? Is Data.Void.absurd total? Is a function producing an infinite stream considered terminating? For models of a simply-typed lambda calculus such as PCF, there are recursive definitions of total elements of types, including function types, but I don’t know whether the same can be said for the more complex Haskell type system. See also the levity subtleties uncovered in…

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

FWIW I love tomland and I have implemented support for version 1.1.0 of the specs. In that thread I had offered to maintain the package, the offer still stands. Pull request kowainik/tomland Support TOML 1.1.0 (mixed arrays, new AST, spec-conforming validator) (#470) main ← andreabedini:toml-1.1.0 andreabedini opened 02:20AM - 09 Oct 26 UTC +1921 -906 Hi! I really like tomland, especially for its bidirectional codecs, and it made …me a bit sad to see it fall behind the spec. Now that I have…

How to refactor this code combining IO and Either?

I prefer value level since it’s more explicit, but other people like implicit. Other than that I can’t see a distinct difference. A couple of comments: The implementation in the linked blog post can only throw instances of class Exception, which isn’t necessary in my version, but I don’t think that’s required either. In both cases the “capability” to throw can escape its scope. To avoid that you need to track scope, either with Bluefin (for the value-level version) or effectful (for the type…

How to refactor this code combining IO and Either?

brandonchinn178: That is a cool technique, and it does solve error composition in that you simply pass two Exception e arguments to compose two exception types Exactly! brandonchinn178: it still requires you to add the exception to all intermediate functions between try and throw Yes, and I consider than an upside. I recognise that some people consider it a downside brandonchinn178: What upsides/downsides do you see here, other than error composition? The main upside for me is that you can’t…

Fun with OverloadedRecordDot: Logging

I guess lots of Functor-like types could have a “passthrough” HasField instance as a shorthand for “fmapping with a field accessor”. Other types can have “extracting a field and massaging its result type into some useable form” instances. I find HasField instances that “invent” new field names a bit suspect (no big reason really, just my gut feeling) but passthrough instances that transform or obtain some preexisting field are ok I think. My particular weird HasField instance was on the Optic…

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

For the last three years I’ve been maintaining a subset of the Kowainik ecosystem to keep stan (the static analyser) up to date with GHC releases. I am stopping maintaining them effective immediately. If anyone is interested in stepping in, let me know. Maintenance involves also maintaining about 15 of stan’s reverse dependencies from within the Kowainik ecosystem too. The most widely used such package is tomland. (I also maintain relude and validation-selective but they have other active…

Catching (async) exceptions

adamgundry: So I think what is happening in your example is this: You have two threads, the main thread (ThreadId 4) which is waiting in threadDelay, and the forked thread (ThreadId 5) which is allocating wildly in threadFunc. Eventually, an allocation hits the memory limit, so GHC bumps the limit by -Mgrace and throws HeapOverflow to the main thread. In the “expected” case, the main thread catches this exception in myExceptionHandler, prints it, then quickly exits (killing thread 5 in the…

Fun with OverloadedRecordDot: Logging

Oh I mean it’s only for internal use. The types are a bit scary here since it’s a super general interface. But the gist is I have a bunch of Hook fields, and I want to make it easy to do hooks <- getHooks out <- runHook hooks.foo inp The HasField instance basically lets you do out <- getHooks.foo inp (automatically calling runHook)

Fun with OverloadedRecordDot: Logging

I feel like I shouldn’t like this, but I like this a lot, it’s very readable which I always appreciate. Reminds me a bit of one of the changes in most recent Clash release, which adds an instance for instance HasField name r a => HasField name (Signal dom r) (Signal dom a) which makes working with signals of records so much more convenient.

Fun with OverloadedRecordDot: Logging

Co-signed. I’m doing pineapple-on-pizza levels of controversial nonsense in personal code with HasField when it feels nice. {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedRecordDot #-} import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT) import GHC.Records (HasField(..)) instance HasField "value" (MaybeT m r) (m (Maybe r)) where getField = runMaybeT data User = User { name :: String, age :: Int } deriving Show justUser :: MaybeT IO User justUser = pure (User "Ada" 36) nothingUser ::…

Fun with OverloadedRecordDot: Logging

brandonchinn178.github.io Fun with OverloadedRecordDot: Logging I like -XOverloadedRecordDot. There, I said it. It's a controversial extension, and can produce obscure errors, but the ergonomics of having type-namespaced operations instead of global-namespaced or qualified-module-namespaced operations is too... A short snippet for overloaded record dots with logging, including a fun technique writing a HasField instance on monadic values

Catching (async) exceptions

adamgundry: Can you give an example program that illustrates this problem? I believe the default exception handler, forkIO and async exceptions work “as expected”, but these things are subtle to understand, and there are definitely dark corners with other features (e.g. FFI or unsafePerformIO)! Here’s a modified version of the program above module Main where import Control.Concurrent (forkFinally, forkIO, myThreadId, threadDelay) import Control.Exception (SomeException, handle) import GHC.Conc…

GHC 9.12.5-rc4 is now available

If you want to use GHC 9.12.5-rc4 with Stack: Add a setup-info dictionary to a configuration file with the applicable entry for your operating system. For example, on Windows or macOS/AArch64, a stack.yaml: snapshot: nightly-2026-11-03 # GHC 9.12.4 compiler: ghc-9.12.4.20261102 compiler-check: match-exact # Anticipating possible future RC releases # Only required before the GHC version has been installed: setup-info: ghc: windows64: 9.12.4.20261102: url: h…

Life after Haskell

rpeszek.github.io Infrequent, Pragmatic, Lambda Blog - Life after Haskell, HKT flattening... We are trying to meet monthly at Boulder Haskell Programmers Meetup and welcome new participants. We will discuss “Life after Haskell” this month (loose discussion). Meetup Life after Haskell, Tue, Nov 17, 2026, 5:30 PM | Meetup Every month we try to meet to hang out and talk functional programming. This month’s speaker is Robert Peszek but the meeting will likely be a loose conversation rather tha