Haskell

Jose_A_Alonso,
@Jose_A_Alonso@mathstodon.xyz avatar

Extending destination-passing style programming to arbitrary data types in Linear Haskell. ~ Thomas Bagrel. https://www.tweag.io/blog/2024-03-07-dps-haskell

mangoiv,
@mangoiv@functional.cafe avatar

I hope to add the todo function to the GHC's base Prelude and hence opened a proposal with the core libraries committee:

https://github.com/haskell/core-libraries-committee/issues/260

Please do not hesitate to leave a ❤️ and comment if you have something to say on this topic.

If you find any errors or weirdnesses in the proposal itself, please comment under this post, not the proposal.

Thank you!

The Haskell Unfolder Episode 21: testing without a reference (well-typed.com)

The best case scenario when testing a piece of software is when we have a reference implementation to compare against. Often however such a reference is not available, begging the question how to test a function if we cannot verify what that function computes exactly. In this episode we will consider how to define properties to...

maralorn,
@maralorn@chaos.social avatar

I have been appointed to the ghc steering committee. Very excited about contributing to make move forward. Seeing who left the committee there are some shoes left there which I won’t even try to fill.

mangoiv,
@mangoiv@functional.cafe avatar

@maralorn congratulations! I’m sure you’re a great fit! ❤️

simonmic,
@simonmic@fosstodon.org avatar

@maralorn Congrats and thanks!

underlap,
@underlap@fosstodon.org avatar

After my recent crash on arch, the system installation of ghc is so badly broken that I'm temporarily using i3 instead of xmonad. Not having a massive dependency for my window manager feels good, but I love xmonad and would like to get back to it.

If only I could nuke the ghc install and get back to sanity. I've tried reinstalling ghc and all the Haskell libraries to no avail.

underlap,
@underlap@fosstodon.org avatar

And, yes, it seems the OS version needed unborking.

mangoiv, German
@mangoiv@functional.cafe avatar

GHC2024 has landed on HEAD and will be part of GHC 9.10, notable changes include:

  • GADTs + MonoLocalBinds
  • DataKinds
  • LambdaCase

Sadly no BlockArguments (Haskeller appear to love their dollars) and TypeData (time hasn’t come I guess)

Also thank god no ImpredicativeTypes and TypeFamilies

https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12084

Also please thank @nomeata for pushing this forward! 👏

#haskell

jaror,
jaror avatar

@mangoiv what's bad about ImpredicativeTypes?

2024 Haskell Ecosystem Workshop, June 6-7, co-located with Zurihac (discourse.haskell.org)

In this two-day event, held on the lakeside campus of OST in lovely Rapperswil, Switzerland, you can learn what you need to know in order to get started working on these tools. We’ve asked the presenters to identify ‘good first issues’ for those wanting to get their feet wet on contributing. Because the workshop is...

haskell,
@haskell@fosstodon.org avatar

Haskell is one of the organizations selected for Google Summer of Code 2024! 🌟 This is a great chance for OSS newcomers to dive into the ecosystem and make a lasting impact. Huge thanks to all who submitted project ideas and volunteered as mentors! https://discourse.haskell.org/t/haskell-selected-for-gsoc-2024/8916

brokenix,
@brokenix@emacs.ch avatar

fixpoint combinators like Y can't be well-typed in . Specifically, something of the form x x requires x to have two conflicting types simultaneously. In dynamic languages, this doesn't matter because you just don't care what the type is, only that you can use the value in some way. But a Haskell compiler does care. However there's no need for such combinators, because Haskell's solution fix f = let x = f x in x is more elegant anyway, and has no typing difficulties (but does require lazy evaluation).
is perhaps not the best launchpad to haskell , to their credit they make good fp presentations
https://stackoverflow.com/questions/68975627/translating-a-fixed-point-operator-to-haskell-language

joeyh,
@joeyh@hachyderm.io avatar

@brokenix No need for Y Combinator. Indeed.

Yuras,

The difference between FFI design in in
In Haskell all the heavy lifting happens in haskell. I.e. you allocate and free memory, peek and poke data from/to C structures etc. As a result, C part known almost nothing about haskell.
In lean it's other way around: C functions get lean objects as arguments, convert them into C data, create new lean objects and return them. As a result, lean's C API is big, complicated and unstable.

kosmikus, (edited )
@kosmikus@functional.cafe avatar

The next episode of the Unfolder will be on Wednesday, 2024-03-06, on property-based testing, more specifically on "testing without a reference", i.e., what to do if you want to test code but do not have any kind of reference implementation available.

https://www.youtube.com/watch?v=ZHB8UAi6cO0&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=21

underlap,
@underlap@fosstodon.org avatar

TFW you cobble together a Haskell program of less than 20 lines of code with one dependency (in addition to the standard runtime) and it takes several minutes to build (the first time around).

mangoiv,
@mangoiv@functional.cafe avatar

@underlap thank you :)

ffaff,
@ffaff@aleph.land avatar

@underlap Was is lens or — shivers — pandoc?

terrorjack,
@terrorjack@functional.cafe avatar

one aspect still sucks is build parallelism:

  1. vanilla cabal builds are coarse grained and have component level build dependency

  2. cabal/ghc has multiple home units now but that's only for repl for the time being

  3. cabal/ghc has semaphores now so multiple ghc --make -jsem processes can share cpu cores without oversubscribing. which is nicer, but not nice enough

  4. semaphore format is home brew and not something more standard like make jobserver. hard to fit in external build systems

  5. external build systems resort to using oneshot mode instead of make mode, so one ghc invocation produces one .hi .o pair, and a fair amount of cpu cycles is wasted compared to make mode due to repeatedly building context that could have been shared

  6. more importantly, once .hi of upstream module is emitted, before ghc -c exits, downstream module should queue for compilation immediately. but this is tricky to implement and often omitted

  7. ironically the wasted cpu cycles in ghc oneshot mode is often compensated by increased parallelism. because external build systems parse cabal metadata but breaks cabal component level dependency wall

  8. but now there's a thing called cabal custom setup and now you need to resort to actually respecting Setup.hs for those packages and they can easily become bottlenecks of a build

  9. the people equipped with knowledge to fix the situation thoroughly have tons of more important issues on their plate

leftpaddotpy,
@leftpaddotpy@hachyderm.io avatar

@terrorjack and as you undoubtedly know there's the workspace abuses that can be done to hand the entire thing to ghc: https://jade.fyi/blog/cabal-test-dev-trick/

another annoying thing about the one shot mode is that it's necessary to be able to distrust the incremental compilation of ghc and have a build system without a concept of previous build. so you have this very frustrating tension between good parallelism and incremental builds in such systems and i have no idea a proper solution: https://jade.fyi/blog/the-postmodern-build-system/

pmidden,
@pmidden@fosstodon.org avatar

"lexical error in string/character literal at character '\8205'" — no emojis in my ‽ I'm shocked!

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@pmidden

> graphic → small | large | symbol | digit | special | " | '

> special → ( | ) | , | ; | [ | ] | ` | { | }

So, if a character doesn't have one of the acceptable Unicode classifications, it's not allowed in string and character literals.

That is surprising, but might have had utility in the past.

You can probably use Data.Char.chr to get what you need, I'd think, at least in GHC.

haskell,
@haskell@fosstodon.org avatar

The Haskell.org Committee is thrilled to welcome new members on board: Avi Press, Matthías Páll Gissurarson, and Moritz Angermann. A big thank you to Tikhon Jelvis, Ryan Trinkle, and Ida Bzowska, who served as committee members until the end of 2023, contributing significantly to various projects within the language ecosystem and community.

DiazCarrete,
@DiazCarrete@hachyderm.io avatar
jaror,
jaror avatar

@DiazCarrete I don't think I'd want to change the string type that often, but being able to make it be a specific type instead of having it be overloaded would be nice.

jaror,
jaror avatar

TIL strict-containers exists and includes strict vectors.

terrorjack,
@terrorjack@functional.cafe avatar

ok. sparks is indeed a nice way to get work stealing nested parallelism for free in , as long as you work with spark# directly and don't use par, pseq or anything built upon these combinators

leftpaddotpy,
@leftpaddotpy@hachyderm.io avatar

@terrorjack oh no lol, why is the lib so unfit for purpose?

terrorjack,
@terrorjack@functional.cafe avatar

@leftpaddotpy spark# is state# passing so you can explicitly spawn a spark as a monadic operation in io or st which feels natural. on the other hand, par's purity is an undesired burden because you now have evaluation order to worry about and litter your code with pseq. the entire "Strategy" thing and "Eval" monad in the parallel package is a huge distraction in the same sense

flora_pm,
@flora_pm@functional.cafe avatar

Flora v1.0.16 is released!

Little badges signalling the use of a Custom build type have been added.

mangoiv,
@mangoiv@functional.cafe avatar

@flora_pm thank you, extremely appreciated! ❤️

mangoiv, (edited ) German
@mangoiv@functional.cafe avatar

Instead of doing something sensible I spent my Saturday on making an alternative hoogle web frontend with focus on simplicity, prettiness and speed.

Try it out on https://hoogle.mangoiv.com and tell me if you like it.

Code can be found at https://git.mangoiv.com/mangoiv/modern-hoogle

NixOS module pending

mangoiv,
@mangoiv@functional.cafe avatar

Now with open search and sharing of the query

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

Anyone know of an interactive "lambda calculus" expression evaluation site? Or something in that UX neighborhood that I should use for inspiration?

I know I used to answer a lot of questions just by stepping though evaluation. I thought it would be nice to have that on a website and I have a basic expression parser and visualizer in running on my website ("production" is a buggy version, tho) but need to design interactive stepping.

https://gitlab.com/bss03/halogen-lambda

jaror,
jaror avatar

@BoydStephenSmithJr there is https://chrisdone.com/toys/duet-delta/ which is fully online and https://www.well-typed.com/blog/2017/09/visualize-cbn/ which is a tool that can generate interactive html pages. The latter supports much more of Haskell, I believe.

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