Issue 424 :: Haskell Weekly newsletter (haskellweekly.news)
News about the Haskell programming language from 2024-06-13.
koz, Someone who knows #Haskell and ML: is there a writeup somewhere explaining how first-class modules (a la ML) can do similar things to Haskell type classes? I'm finding it hard to figure that out.
To give a more concrete case: suppose I wanted to write something like Control.Applicative, which provides an 'interface' Applicative with some methods, as well as functions that work for any Applicative. How would I do this with ML-style first-class modules?
DiazCarrete,
DiazCarrete, (edited ) Some proposals:
Explicit Splice Imports https://github.com/ghc-proposals/ghc-proposals/pull/412
Pure Template Haskell https://github.com/ghc-proposals/ghc-proposals/pull/655
Unicode Syntax for Template Haskell splice https://github.com/ghc-proposals/ghc-proposals/pull/647
Add support for executing TH splices on the host platform during cross compilation. https://gitlab.haskell.org/ghc/ghc/-/issues/24339
Allow splicing Stmt https://gitlab.haskell.org/ghc/ghc/-/issues/24953
Name should be spliceable https://gitlab.haskell.org/ghc/ghc/-/issues/24922
DiazCarrete, Another Template Haskell tutorial, also from 2021
https://serokell.io/blog/introduction-to-template-haskell
maralorn, I have real trouble developing an intuition for NoDeepSubsumption.
I always only notice by sheer luck that changing
a . b $ c
to
a $ b $ c
fixes my type error.
BoydStephenSmithJr, @maralorn I also still have problems with this in #purescript, too.
Best tip I have is to pay more attention to the 'forall's. Compose /
.
/<<<
"fixes" the 'forall', which can cause type checking to fail elsewhere or, if "a" is higher-rank, there (it forces "b" to be monomorphic; higher-rank "a" might require a polymorphic "b'). Application / '$' (in GHC) doesn't "fix" the forall.I think the difference might be "deeper", but for me it's able where the "choice" for the forall is made.
mangoiv, My favourite #haskell row polymorphism package is aeson
aeveltstra, @mangoiv Why aeson?
lxsameer,
kosmikus, @lxsameer Not really dependent on Nix, I'd say. You can use Nix if you want to, sure, but also cabal(-install) itself is much better than it used to be.
haskell, #Haskell on arm64 Windows — let's goooooo
terrorjack, @haskell https://gitlab.haskell.org/ghc/ghc/-/issues/24603 for the discussion thread and instructions for reproducing the result
mikwee, Shoutout to the @haskell team for making such a cool tutorial available on their home page.
mangoiv, Behold: cursed non-sense that doesn’t work well but is conceivable to work well with a few more minutes (sorry for not putting them in)
https://bin.mangoiv.com/note?id=95b5b823-05fe-4806-ab40-88c35892936a
mangoiv, I think the only thing that needs to be done is to come up with a clever type class that does some flipping for you, based on the arguments. It’s not entirely trivial but might work. #haskell
neloj, I've been trying to make this work for a few days and finally I achieved it, the most basic form of a wayland client using unix sockets, and well in other languages it was not difficult at all, I did it in hare, c, typescript (deno), and in the end I wanted to try with a language that I had never used, Haskell, and I learned many things but I still don't know what a monod is, anyway, here I leave a link to the code for those who are interested: https://gitlab.com/-/snippets/3711372
#haskell #programming #wayland
News about the Haskell programming language from 2024-06-13.
6d03, Why is there no
MonadFail
instance forEither String
in the prelude?
"Duality" is the idea that two concepts are "similar but opposite" in some precise sense. The discovery of a duality enables us to use our understanding of one concept to help us understand the dual concept, and vice versa. It is a powerful technique in many disciplines, including computer science. In this episode of the Haskell...
DiazCarrete,
mangoiv, this was a lot of fun (named arguments in #haskell by using
-XOverloadedRecordUpdate
)https://bin.mangoiv.com/note?id=837d3a48-e34e-48e8-b519-8c775f146262
jaror, I just saw an old commercial and just had to make this:
kosmikus, Well-Typed is releasing the materials for my video-based #Haskell intro course to the public, starting today and continuing over the next few weeks. Initially, parts 1 (Introduction) and 2 (Datatypes and Functions) are available.
acowley, Great to see this effort on improving template #Haskell! I think that figuring out why people don’t use quotes more is partly answered by the volume of deficiencies already identified. When you find that a quote doesn’t do something you need, it’s not totally uncommon to switch away from them altogether. https://informal.codes/posts/stabilising-th/
This is the second of a two-part series of blog posts focused on GHC’s specialization optimization. Part 1 acts as a reference manual documenting exactly how, why, and when specialization works in GHC. In this post, we will finally introduce the new tools and techniques we’ve developed to help us make more precise,...
DiazCarrete, (edited ) "A strict binding (with a top level !) should not be thought of as a regular pattern binding that happens to have a bang pattern [...] on the LHS. Rather, the top level ! should be considered part of the let-binding, rather than part of the pattern."
I didn't know about this distinction! Found out about it when fiddling with linear let-bindings in GHC 9.10.1.
https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/strict.html#strict-bindings
https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/linear_types.html#bindings
https://www.reddit.com/r/haskell/comments/1d9kexm/comment/l7i5csk/
News about the Haskell programming language from 2024-06-06.
tristanC, I demonstrate a pipewire video source drawn with #Haskell :) https://github.com/TristanCacqueray/pipewire.hs/blob/main/pipewire/examples/VideoSrc.hs
mangoiv, Removing the reexports from mtl was, while I really like it conceptually, quite the breaking change, apparently it had become a habit in my team to just import Control.Monad.Except to get access to Control.Monad and Control.Monad.IO.Class… On that note: why’s there no Control.Monad.IO, why do I have to type .Class all the time.
abcdw,
News about the Haskell programming language from 2024-05-30.
tristanC, I get a tone playing with my #Haskell bindings to pipewire :) https://github.com/TristanCacqueray/pipewire.hs/blob/main/pipewire/examples/Tutorial4.hs