H
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
H
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 ?
H
This is a ridiculously cool way to demonstrate the tool. Nice work.
H
Yeah, you can make that code work if you enable ImpredicativeTypes and add two type applications: middlewares app = foldl' @[] @Application (flip ($)) app $ [ middleware1 , middleware2 , middleware3 ] Haskell Playground But it is not ideal if you have to explain this to your users (and I didn’t get this right in one go).
H
lol, funny u say that… https://demo.kalesvolgh.haskell-game.dev/
H
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…
H
Just an idea - can this be compiled to WASM and showcased in the browser?
H
And lens does something similar with its Reified wrappers
H
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.
H
And a clear limitation is that you can’t do things like [Application] (putting applications in a list) if Application is a newtype with a forall in it, unless you also enable the ImpredicativeTypes extension. Did you mean “type synonym” here?
H
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.…
H
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 ->…
H
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…
H
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 -…
H
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…
H
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…
H
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…
H
Is this something to file as a bug, then? I avoided opening an issue on stack because it requires me to test in the latest version, which also wasn’t trivial to get on my system. Thank you for testing though, I am guessing this setup isn’t very common? Is having src+app directories the norm?
H
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…
H
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 =…
H
telorum.codeberg.page Kalesvolgh - changelog we have a changelog page now, and I’m maintaining the changelog regularily now. but, this’ll be my last announcement till we have docs and somewhere close to v1 v0.2.1.4 is now out and introduces a few bug fixes and some important things to moulding which u can check out on the changelog page
H
Kiitos! (Thank you in Finnish) I love to think about Cape Cod every time you talk about Haskell infrastructure It looks like a beautiful place.
H
Looks like everything is back up following a successful operation! Let me know if anything seems amiss.
H
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…
H
I’m amazed with the type of projects you do after apparently only 1 year of learning Haskell.
H
website is up lol Kalesvolgh - Home (I promise I tried)
H
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.
H
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.
H
For a second I’ve thought you can now make models in tidal notation…