GHC 9.4.1 is now available
discourse.haskell.org
discourse.haskell.org
\foo bar baz -> case (foo, bar, baz) of
(Just 4, 3, False) -> 42
_ -> 0
-- becomes
\cases
(Just 4) 3 False -> 42
_ _ _ ->
--- extremelyLengthyFunctionIdentifier (Just a) False = Just 42
extremelyLengthyFunctionIdentifier (Just a) True = Just (a / 2)
extremelyLengthyFunctionIdentifier _ _ = Nothing
-- becomes
extremelyLengthyFunctionIdentifier = \cases
(Just a) False -> Just 42
(Just a) True -> Just (a / 2)
_ _ -> NothingIf you're curious about Haskell, IHP is a good starting point (https://ihp.digitallyinduced.com/ https://github.com/digitallyinduced/ihp). IHP is Haskell's version of Laravel/Rails/Django. It's really a superpower to have Haskell's type system combined with the rapid development approach of Rails :) (Disclaimer: I'm founder of the company that makes IHP)
Off the top of my head:
* Haskell language server solved the ide support problem
* Easy record access with . syntax (i.e. person.name to get a name off a person)
* A new {-# LANGUAGE GHC2021 #-} pragma that turns on a bunch of flags by default to write modern haskell
* GHCup to control installed haskell & tool versions
* Haskell foundation formed to support growing haskell
* A proposal* to work towards supporting dependent types was accepted
A lot more of course but it all points to making haskell more enjoyable to get into and use, and a good future ahead.
I've tried it since it was Haskell IDE Engine and only recently does it seem to "just work" without edgecase bugs (Template Haskell) or configuration
It's hard to take a language seriously that doesn't have a good IDE story.
I wrote a massive rant to Tom Ellis about why I thought writing Haskell was a terrible user experience and most of my complaints have been resolved in the last year or so.
But basically it's a meta-extension that flips on a bunch of extensions that most haskell users would come to expect as 'default'.
As a simple example: TupleSections. If the compiler complained to me that I needed to turn on TupleSections, I wouldn't take a minute to consider whether it was a good idea, I'd just be annoyed that I hadn't flipped it on somewhere already.
Actually that flag existing is part of why I think new books are being written, to start defining what "modern" (with all these flags on by default) haskell looks like.
I'm uncertain about Haskell ever becoming very popular. Rust seems to be sucking a lot of oxygen out of the room for new application programming languages, and Haskell is so old that I'd expect it to already be popular if it were ever going to become popular on its own merits. This doesn't matter much to me. There is enough manpower in the community to maintain the tooling and infrastructure, which keeps improving, and the language is fundamentally very very good.
I originally learned Haskell from the book Real World Haskell. It's probably dated now (the language and libraries have changed), but I would certainly welcome an updated second edition.
Hopefully someone finds the presentation interesting if they haven't seen it before :)
I wonder if a less lazy by default version of Haskell might have had any more success in the wider world. I know in the .NET world I've been burned more than a few times by the way Linq is lazy unless expressly realized (via methods like ToArray() and ToList())
I have however noticed that while much Haskell code doesn't make very fancy use of laziness, it is widely used for very local control flow. E.g. a pattern I see relatively often is `fromMaybe (error "...some message")`, which would be problematic in a strict language (because `error` would always be evaluated).
Even without partial functions, laziness can also simplify code structure when you can just 'let' bind any value that will possibly be used on any control flow path, without worrying about unnecessary computation.
These conveniences are not deal-breakers - I get by without them just fine in SML - but they do serve to make the language a bit nicer.
Although in your fromMaybe case couldn't you just have it generate short circuiting code under the hood instead of always evaluating? That isn't necessarily quite the same thing as laziness.
The beauty of functions like fromMaybe is they're only that - just plain, regular functions. No special casing under the hood required.
The essence of Haskell is non-strictness. It is the very reason Haskell was created.
There are already strict functional languages, like OCaml. What value comes from stripping Haskell of the soul of its existence?
I would highly recommend https://simonmar.github.io/pages/pcph.html regardless of which language you use day to day. It a treasure trove of excellent information.
1. Wasn't clear on environment/toolchain and ended up compiling for a long time just to install one package. Pretty sure I was doing it the wrong way but saw inconsistent information about what to do. I'm almost sure this is fixed by now, or at least enough for me to stop complaining about it.
2. The runtime seemed more annoying than I'm accustomed to. I remember trying to load some haskell code into another program, and it was modifying the signal handlers, which was totally unacceptable for my use case so I gave up. This is an area rust is much better.
3. It was difficult to use ghci-like functionality from another program (compile bits of haskell code). Maybe it's more library-like now and I can just use ghci now? Neither rust nor haskell is great here.
This can still happen. Unless you use Nix (don't do this unless you already like Nix), there is no distribution of precompiled Haskell packages. Some "framework"-like packages recommended to beginners may depend on a huge number of other packages.
> 2. The runtime seemed more annoying than I'm accustomed to. I remember trying to load some haskell code into another program, and it was modifying the signal handlers, which was totally unacceptable for my use case so I gave up. This is an area rust is much better.
It is still annoying. Haskell will definitely hijack your signal handlers. It needs them to handle timers, to handle garbage collection, and maybe do other things in the concurrent IO system. I'm not aware of any work to make it collaborate with other signal handling shenanigans, but I haven't looked. I doubt it is possible; Unix signal handlers really are not a good foundation for modular design.
> 3. It was difficult to use ghci-like functionality from another program (compile bits of haskell code). Maybe it's more library-like now and I can just use ghci now? Neither rust nor haskell is great here.
This is most likely easier. GHC has become much more friendly to library use.
Interesting, is this a blockchain proof of stake/work system where the work done is running a CI for GHC?
Thus by staking ada (cardano) with the stake pool, one can “earn” a competitive rate (~4%) of stake return as well as support GHCs CI indirectly as the excess operational rewards from running the pool are put towards running CI machines for GHC.
To compare this to some non-blockchain scenario:
Depositing money at a bank will yield some interest, but also provide the bank with some operational return (they usually don’t provide you a savings account due to altruistic reasons); and the operational rewards the bank would use to run CI machines for GHC.
I hope this makes sense, and explains the concept of how this works in principle.
I got excited for a moment and thought that the compilation was being used instead of hashing as a proof of work. That would require compilation to be trivially verifiable though, so sadly it is not the case.
The non-blockchain equivalent of this would be: "If you are buying stuff on Rakuten please use "Zw3rk" as referrer code! I promise I'll spend all money earned by referrals on servers for GHC CI"
So yes, technically this is a blockchain system which supports GHC CI... but practically it is all traditional hardware and regular cash after the first step.
In other news, Cabal 3.8 supports stackage snapshots kinda: https://discourse.haskell.org/t/just-released-cabal-3-8-1-0/...
I’m using coc.nvim[1] as my LSP client. It works really great with HLS. Maybe you can give it a try?