XIO

xWire

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

Haskell Community - Latest posts

Latest posts

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.

Purpose of Network.Wai.ResponseReceived

jackdk: The only reason I can think of is that a simpler interface was chosen to make it easier for users to follow. Type inference for higher rank types is undecidable. GHC is pretty good nowadays with ImpredicativeTypes but it is still complicated, and you will probably run into unexpected limitations. For example the DeepSubsumption extension is a slight change to the type system which had bigger real world implications than anticipated. See the simplify subsumption proposal for examples.…

Purpose of Network.Wai.ResponseReceived

rini: From the documentation of that extension, Rank2Types used to mean a different restriction, and I also can’t see why this type isn’t a rank-1 type. You’re technically right and the type forall r. Request -> (Response -> IO r) -> IO r is itself not a higher rank type. However, there are a few nuances: GHC used to only allow the keyword forall if RankNTypes (or Rank2Types) was enabled. Nowadays you can use ExplicitForAll and write a function signature like this:foo :: forall r. Request ->…

Mutants at the MCG - 6:00 PM Thurs 12th of November

Melbourne Compose Group is the monthly in-person meetup for functional programmers in Melbourne, which this month, is on the second Thursday of the month. ​Our November meeting will be 6:00-8:00 pm Thurs 12th of November at our regular venue, Activity Room 2 at Kathleen Syme Center in Carlton. Arrive from 5:30 for chat and socialising, talks start at 6:30pm. Please RSVP via Luma. ​Tristan Mc Leay - Mutation Testing With Sydtest ​Now that use of AI code generation tools has become prevalent, we…

Output Existentials

Consider read :: forall a. Read a => String → a The forall’d type is the output type. Even if it looks like a return type, but first BEFORE the computation during compile time (except 1 case) it was used as INPUT type. Haskell is a statically-typed language. Inference can’t wait ‘til runtime to find out what some return type is. Hopefully, Haskell ALREADY support Runtime for types (this 1 exception) data E = forall a. MkE [a] lengthE :: E -> Int lengthE (MkE @e xs) = L.length @e xs What I try -…

Output Existentials

Richly typed programming invariably uses its share of existential types, [quoting from the Motivation] I think that’s not true. There’s a style of Haskell (“Finally tagless”) that deliberately avoids existentials and GADTs. Rust programming doesn’t support GADTs (and I understand has no plans to); you can achieve the effect via overloading and traits — something akin to Haskell type classes and Associated Types. Rust considers type inference for GADTs to be too complex. I wish you would just…

Output Existentials

VitWW: In Haskel forall quantifier is stands for … input type! I think this is not true. (Or I don’t understand what you’re claiming.) Consider read :: forall a. Read a => String → a The forall’d type is the output type. And it must be Universally quantified, so that whatever calls read can type-safely consume that type. VitWW: during runtime it could be substituted to Monomorphic type. Haskell is a statically-typed language. Inference can’t wait ‘til runtime to find out what some return type…

Purpose of Network.Wai.ResponseReceived

If designing from scratch in 2026, I imagine it would be less controversial to use the higher-rank type. type Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived was first defined in wai-3.0.0, released in 2014. Strangely, Network.Wai enables {-# LANGUAGE Rank2Types #-} but the authors appear to have decided on exposing a simpler interface, so it could not have been chosen to broaden support across Haskell compilers. Even the ancient GHC 6.8 (2007) supports…

Purpose of Network.Wai.ResponseReceived

Specifically, the documentation states “This is to avoid the need for Rank2Types in the definition of Application.” I do vaguely remember why the Application type cannot be simply Request -> IO Response, the explanation being in a talk about wai, but first thing that comes to my mind is changing the type into this: type Application = forall r. Request -> (Response -> IO r) -> IO r Without enabling any extensions, this works on GHC 9.10.3. But seemingly using NoRankNTypes makes it not work, so…

Output Existentials

With Output Existentials it is possible to write Nat-Vectors: data Nat = Zero | Succ Nat type Vec :: Nat -> Type -> Type data Vec n a where VNil :: Vec Zero a (:>) :: a -> Vec n a -> Vec (Succ n) a infixr 5 :> toVec :: forall a. [a] -> exists (n::Nat). Vec n a toVec [] = therefore @Zero in VNil toVec (x:xs) = therefore @(Succ m) in x :> tvxs where tvxs :: exists m. Vec m a tvxs = toVec xs filterVec :: forall a (n::Nat). (a -> Bool) -> Vec n a -> exists (m::Nat). Vec m a filterVec p VNil =…

Output Existentials

I spent over a year trying to improve my proposal how to easyly implement Existential types into the Haskell. And I have a brilliant idea! In Haskel forall quantifier is stands for … input type! So we add exists quantifer for … output type! ForallType during Typecheck is checked and become Monomorhic by substitutional law. But ExistentialType during Typecheck is checked but remains Polymorphic. And … during runtime it could be substituted to Monomorphic type. Output Existentials do NOT cover…

New Functionality in Waterfall-CAD

slow-dive: White adjacent to yellow though? As someone who was into speedcubing once I have to disagree with that choice … I’m also using “Fuchsia” rather than Orange, because I couldn’t think of a better predefined colour pallet than the 16 original HTML named colours, and also didn’t want to fill the video with hex codes. It’s not ideal.

Planned maintenance for gitlab.haskell.org, downloads.haskell.org, mail, and more: 2026-10-27

An admin will be physically replacing storage devices on an important server. The following services will experience downtime or interruption: gitlab.haskell.org (fully offline) hoogle.haskell.org (fully offline) downloads.haskell.org (mitigated by a CDN) mail to haskell.org addresses (delayed) The work is tentatively planned around 04:00 UTC on October 27. If all goes well, the downtime should be on the order of minutes.