I'm going to return to #haskell after a very long time. Back then, the #cabal hell was excruciating. But now, thanks to #nix, setting up a project is like two seconds from the time you decide to create it to the point you start coding.
@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.
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.
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
@mangoiv@maralorn Yes, I agree with this view. I don't think Maybe is the right analogy. The MVar being empty is not a case you have to explicitly deal with, it already has a behaviour attached to it (blocking). Regarding the missing entry in the square, isn't that just an IORef?
Yeah, It's kinda IORef but I thought that doesn't count because it has less concurrency guarantees.
But I think I get now why MVars are much more useful. I have even used TMVars myself as locks when the action I wanted to do with it contained effects.
how the hell do you add dependencies in Haskell stack, I add yesod to the build-depends in the cabal file like shown in the stack example but on running stack build it fails saying it couldn't find yesod, and then the line is removed from the cabal file. Haskell ecosystem is hell.
I personally really like how Haskell Stack works (package sets are amazing), but the interactions between it and the Cabal file are definitely confusing
I know that Megaparsec doesn't backtrack automatically and that you have to use "try" for that, but this behavior of "many" was unexpected. Why oh why doesn't it parse the final space? https://stackoverflow.com/a/78355045/1364288
Maybe I didn't read the documentation thoroughly, but I don't think it's actually spelled out in the Haddocks?
@DiazCarrete
+1 for the other suggestion here: do not eat space before the lexemes (as beginner tutorials tend to show) -- always eat it after the lexemes (and only after the lexemes!), and do it reliably. Hard-learned lesson.
@DiazCarrete IIRC, we don't "try" by default because it can cause excessive backtracking, and having that even be a possibility holds references to things, increasing memory usage, and decreasing performance.
So, yeah, anytime you want to "noncommittally consume", you have to use try explicitly.
The GHC developers are very pleased to announce the release of GHC 9.10.1! 🎉
On the menu:
→ GHC2024 language edition
→ Linear let and where
bindings
→ Annotation of exceptions with backtraces
→ Required type arguments for functions
→ Javascript FFI support in the WebAssembly backend
… and many more!