Issue 418 :: Haskell Weekly newsletter (haskellweekly.news)
News about the Haskell programming language from 2024-05-02.
bgamari, GHC 9.10.1 is at long last released!
Between the continued iteration on the GHC20xx meta-extension mechanisms, further improvements in the JS/wasm backends, and (my favorite) the availability of exception backtraces in
base
, there is lots in this release to be excited about.See the Haskell Discourse thread for the full announcement:
https://discourse.haskell.org/t/ghc-9-10-1-is-now-available/9523
kosmikus, On Wednesday, 2024-05-15, at 1830 UTC, we'll stream the 25th episode of the #Haskell #Unfolder. This episode should be interesting for Haskellers and non-Haskellers alike. Edsko and I will translate a #gRPC server from #Java to Haskell, contrasting the programming paradigms.
https://www.youtube.com/watch?v=YwshlQXKO80&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=25
haskell, Cabal 3.12 has been released! A plethora of changes and improvements, thanks to the dedicated work of the entire team. Grab it and give it a try! https://discourse.haskell.org/t/ann-cabal-3-12-0-0-released/9504 #Haskell
ffaff, Cabal 3.12 released! Lots of new features for #cabal users, but also for #HSL users (multicomponent repl sessions) and much more!
https://discourse.haskell.org/t/ann-cabal-3-12-0-0-released/9504
Boosts appreciated to reach the wider #haskell community!
BoydStephenSmithJr, (edited ) Hey, #Haskell, what's the more conservative extension to the report?
I think I can do what I want either way, but I don't really know how to do it in Haskell2010 with no extensions. (I have a non-parameteric type function/family in my semantics, and don't want to give up totality.)
joeyh, Last week I prototyped a git remote helper in a shell script, and now I'm rewriting that in #haskell as part of #gitAnnex.
I don't do this often and I wonder if it was a mistake, probably I should have written the prototype in haskell and then integrated it into git-annex. It's kind of amazing how a lot of complexity is melting away and also how I'm adding So Many Types and also throwing in a lot of robustness improvements.
joeyh, This reminds me of when I rewrote all of debhelper from shell to perl in a couple days way back when.
mangoiv,
mangoiv, I just realised in my real life example it is worse because d is an unconstrained type variable #haskell
BoydStephenSmithJr, @mangoiv Higher ranked types, FTW?
haskell, (edited ) Haskellers can have a little UwU, as a treat.
https://haskell.org/?uwu=true
#Haskell
yujiri, @haskell nitpick: those are kana, not kanji. kanji are the logographic characters
haskell, @yujiri Thanks!
maralorn, I would like to see CNN style real time coverage of software releases, e.g.:
BREAKING: New ghc release just dropped!
pomCountyIrregs, @maralorn When a showstopper bug/security flaw is found, would it be “BREAKING: {$sw} broken”?
DiazCarrete, Made a video: generating HTML in Haskell using "lucid2"
https://www.youtube.com/watch?v=SQ78GVCzsz0
DiazCarrete, In which I completely mispronounce "lucid", among many other words.
mangoiv, Shoutout to @hecate for https://flora.pm/.
It’s just so awesome to have a fast, modern UI for hackage that really suits all your needs!
lyxia, Bluefin-algae, an algebraic effect library using the Bluefin effect system. #Haskell
https://discourse.haskell.org/t/bluefin-algae-algebraic-effects-in-bluefin/9470
koz, #Haskell Fedi: do
int2Word#
and similar operations have a runtime cost? I assume 'no', but I'd like to be sure.
BoydStephenSmithJr, @koz I'm not sure but I think https://github.com/ghc/ghc/blob/bf3d4db0894233ec72f092a4a34bce9ed4ff4e21/compiler/GHC/Builtin/primops.txt.pp#L817 says that actually no code is emitted for that prim op, which would mean no runtime cost.
Hopefully, a #GHC expert will come through and confirm or correct me.
Of course, that's not part of the language spec, or the public API of GHC, so it could change on a whim. (It won't.)
News about the Haskell programming language from 2024-05-02.
Jose_A_Alonso, The Haskell Unfolder Episode 24: generic (un)folds. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/QTgRKWGDVr0 #Haskell #FunctionalProgramming
kosmikus, The one-year anniversary episode of the #Haskell #Unfolder is starting in about 15 minutes!
https://www.youtube.com/watch?v=QTgRKWGDVr0&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=24
DiazCarrete, lots of info about HKD techniques in this thread
https://discourse.haskell.org/t/hkd-best-or-worst-thing-ever/9450
DiazCarrete, (edited ) Generating safe links for your REST API with Servant
https://youtu.be/KC64Ymo63hQ?si=I_E17cwA0UBQfmAF
kosmikus, The #Haskell #Unfolder is now 1 year old! In the anniversary episode, Edsko and I will return to the very first topic and consider (un)folds, but now in a more generic setting. Live on YouTube 2024-05-01 at 1830 UTC.
https://www.youtube.com/watch?v=QTgRKWGDVr0&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=24
hackuador, Brisbane Functional Programming Group #BFPG May meetup, Tue 14th: #Gleam v1 (Rob Ellen) + Do your taxes with #Haskell (Fraser Tweedale). All curious minds are welcome!
https://www.meetup.com/brisbane-functional-programming-group/events/298454561/
mybarkingdogs, #Haskell, #Jones, #Texas National Weather Service: #TORNADO WARNING in this area until 11:15 PM CDT. Take shelter now in a basement or an interior room on the lowest floor of a sturdy building. If you are outdoors, in a mobile home, or in a vehicle, move to the closest substantial shelter and protect yourself from flying debris. Check media. Source: NWS San Angelo TX
DiazCarrete, AFAIK, there's not an easy way in Haskell to inspect at the type level what type a field has in a record.
What I mean is that that there doesn't seem to be a type family like
type FieldType :: Type -> Symbol -> Type
that we could invoke in ghci like
:kind! FieldType Person "age"
Why would I want this? For libraries like servant and rel8 that use parameterized records where the types of the fields vary heavily with the type parameter.
I guess I could hack it using generics. 🤔
DiazCarrete, "hack it using generics"
^ oh god, my poor memory. I actually did already implement something like this back in the day, using generics.https://hackage.haskell.org/package/red-black-record-2.1.4.0/docs/Data-RBR.html#t:Value
DiazCarrete,
brokenix, quoting @prophet
mli files are mostly used to constrain the visibility of definitions whereas hs-boot files are about allowing mutual recursion between modules (which OCaml doesn't support, even with mli files!)
But the mechanism by which they achieve their goals is nearly identical even though the perception of it is so vastly different.I guess the conclusion to draw from this is that both sides are wrong: IMO, mli files are not nearly as good as OCamlers think they are, but hs-boot files aren't as ugly as Haskellers think either.
-- prettySrcLoc and prettyCallStack are defined here to avoid hs-boot
-- files. See Note [Definition of CallStack]Backpack's design is primarily driven by compatibility considerations (“how do we build upon GHC's existing foundation?”), rather than elegance. In particular, Backpack doesn't eliminate those ugly .hs-boot files, it just automates and hides their generation and processing.
For all their faults, Standard ML and OCaml have pretty good support for modular programming. And, as the Modular Type Classes paper you linked shows, type classes can be built elegantly on top of a good modular foundation.
#ocaml #haskell
https://cohost.org/prophet/post/3251638-it-s-really-interest
https://haskell.fi.muni.cz/doc/base/src/GHC-Exception.html
https://twitter.com/lexi_lambda/status/1172629363730333697
https://news.ycombinator.com/item?id=11371130
sgraf, German @brokenix @prophet See also https://discourse.haskell.org/t/hs-boot-files-should-i-use-them/9164/7?u=sgraf and the GHC issue 1409 I link to
someodd, Do you #haskell as a language, lends itself to fast prototyping and iteration?
DiazCarrete, In Servant, the ServerError type has an Exception instance
https://hackage.haskell.org/package/servant-server-0.20/docs/Servant-Server.html#t:ServerError
You might speculate that when throwing a ServerError using liftIO . throwIO in a Handler, the ServerError is automatically caught and served as a response, but it ain't so: it's treated as just another exception, and the response code is 500.Instead, you should throw ServerErrors using "throwError", re-exported from the "Servant" module.
https://hackage.haskell.org/package/servant-server-0.20/docs/Servant.html#v:throwError
DiazCarrete, (edited ) @BoydStephenSmithJr I don't think it's a bad idea!
I believe we can impement in Servant the throwIO behavior I mentioned earlier by catching (some) runtime exceptions in the callback passed to "hoistServer" and re-throwing them in the "proper" way expected by Handler. https://hackage.haskell.org/package/servant-server-0.20/docs/Servant-Server.html#v:hoistServer
BoydStephenSmithJr, @DiazCarrete I think that universally quantified
x
might be a problem, but I suppose it depends on the type of your re-throw mechanism.