Haskell

bgamari,
@bgamari@mastodon.social avatar

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,
@kosmikus@functional.cafe avatar

On Wednesday, 2024-05-15, at 1830 UTC, we'll stream the 25th episode of the . This episode should be interesting for Haskellers and non-Haskellers alike. Edsko and I will translate a server from to Haskell, contrasting the programming paradigms.

https://www.youtube.com/watch?v=YwshlQXKO80&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=25

haskell,
@haskell@fosstodon.org avatar

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

ffaff,
@ffaff@aleph.land avatar

Cabal 3.12 released! Lots of new features for users, but also for 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 community!

BoydStephenSmithJr, (edited )
@BoydStephenSmithJr@hachyderm.io avatar

Hey, , 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.)

18+ kosmikus,
@kosmikus@functional.cafe avatar

@BoydStephenSmithJr I voted RankNTypes. Arguments in favour: RankNTypes (or at least Rank2Types) existed long before GADTs, and RankNTypes can be translated into "plain" Fω Core, without needing any equality constraints like FC.

joeyh,
@joeyh@hachyderm.io avatar

Last week I prototyped a git remote helper in a shell script, and now I'm rewriting that in as part of .

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,
@joeyh@hachyderm.io avatar

This reminds me of when I rewrote all of debhelper from shell to perl in a couple days way back when.

mangoiv,
@mangoiv@functional.cafe avatar

Out:
(A -> D) -> B -> C -> D

In:
(A -> (D, B, C) ) -> D

mangoiv,
@mangoiv@functional.cafe avatar

I just realised in my real life example it is worse because d is an unconstrained type variable

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@mangoiv Higher ranked types, FTW?

haskell, (edited )
@haskell@fosstodon.org avatar

Haskellers can have a little UwU, as a treat.
https://haskell.org/?uwu=true

yujiri,
@yujiri@freeradical.zone avatar

@haskell nitpick: those are kana, not kanji. kanji are the logographic characters

haskell,
@haskell@fosstodon.org avatar

@yujiri Thanks!

maralorn,
@maralorn@chaos.social avatar

I would like to see CNN style real time coverage of software releases, e.g.:

BREAKING: New ghc release just dropped!

pomCountyIrregs,
@pomCountyIrregs@mstdn.social avatar

@maralorn When a showstopper bug/security flaw is found, would it be “BREAKING: {$sw} broken”?

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Made a video: generating HTML in Haskell using "lucid2"
https://www.youtube.com/watch?v=SQ78GVCzsz0

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

In which I completely mispronounce "lucid", among many other words.

mangoiv,
@mangoiv@functional.cafe avatar

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!

flora_pm,
@flora_pm@functional.cafe avatar

@mangoiv cheers 👍

lyxia,
@lyxia@mamot.fr avatar

Bluefin-algae, an algebraic effect library using the Bluefin effect system.
https://discourse.haskell.org/t/bluefin-algae-algebraic-effects-in-bluefin/9470

mangoiv,
@mangoiv@functional.cafe avatar

@lyxia finally someone uses the native delconts! ❤️
Thank you for making this :)

koz,
@koz@chaos.social avatar

Fedi: do int2Word# and similar operations have a runtime cost? I assume 'no', but I'd like to be sure.

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@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 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.)

Jose_A_Alonso,
@Jose_A_Alonso@mathstodon.xyz avatar

The Haskell Unfolder Episode 24: generic (un)folds. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/QTgRKWGDVr0

kosmikus,
@kosmikus@functional.cafe avatar

The one-year anniversary episode of the is starting in about 15 minutes!

https://www.youtube.com/watch?v=QTgRKWGDVr0&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=24

kosmikus,
@kosmikus@functional.cafe avatar
tristanC,
@tristanC@functional.cafe avatar

@kosmikus Thank you and Edsko, you made folds look oh so easy!

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

lots of info about HKD techniques in this thread

https://discourse.haskell.org/t/hkd-best-or-worst-thing-ever/9450

DiazCarrete,
@DiazCarrete@hachyderm.io avatar
DiazCarrete, (edited )
@DiazCarrete@hachyderm.io avatar

Generating safe links for your REST API with Servant
https://youtu.be/KC64Ymo63hQ?si=I_E17cwA0UBQfmAF

kosmikus,
@kosmikus@functional.cafe avatar

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

mangoiv,
@mangoiv@functional.cafe avatar

@kosmikus neat! The anniversary one I’ll have to watch live, I guess! 😅

hackuador,
@hackuador@functional.cafe avatar

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,
@mybarkingdogs@freeradical.zone avatar

#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

#TxWx #TornadoWarningRelay

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

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,
@DiazCarrete@hachyderm.io avatar

"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,
@DiazCarrete@hachyderm.io avatar
brokenix,
@brokenix@emacs.ch avatar

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.

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,
@sgraf@mastodon.online avatar
someodd,
@someodd@fosstodon.org avatar

Do you as a language, lends itself to fast prototyping and iteration?

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

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

image/png

DiazCarrete, (edited )
@DiazCarrete@hachyderm.io avatar

@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,
@BoydStephenSmithJr@hachyderm.io avatar

@DiazCarrete I think that universally quantified x might be a problem, but I suppose it depends on the type of your re-throw mechanism.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • haskell
  • DreamBathrooms
  • magazineikmin
  • InstantRegret
  • hgfsjryuu7
  • vwfavf
  • Youngstown
  • slotface
  • thenastyranch
  • ngwrru68w68
  • rosin
  • kavyap
  • PowerRangers
  • Durango
  • khanakhh
  • anitta
  • mdbf
  • tacticalgear
  • ethstaker
  • modclub
  • osvaldo12
  • everett
  • tester
  • cubers
  • GTA5RPClips
  • normalnudes
  • Leos
  • cisconetworking
  • provamag3
  • All magazines