How the case-of-known-constructor optimization (along with the worker-wrapper transformation) can optimize away the passing of records as function arguments.
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.
IIUC, of the two main algorithms for topological sorting in directed acyclic graphs, only Kahn's algorithm allows you to give extra priority to some vertices, so that they appear earlier in the resulting ordering.
If your branch has a good number of commits since it diverged from main, rebasing can sometimes seem like a Sisyphean task. Because each commit is applied independently, you often end up resolving merge conflicts again and again in the same places, conflicts that a merge would make you resolve together in one go.
To avoid that, I sometimes squash together all the commits in my branch before rebasing on top of main. But then of course I lose the structure of the separate commits.
It seems that, if you want to check for some value-level condition when matching, you need to bring in ViewPatterns. This is mentioned in the wiki but not (explicitly) in the GHC user guide.
I was trying to reproduce some of the laziness issues described in this old (2016) but very in-depth article at the Well-Typed blog: https://well-typed.com/blog/2016/09/sharing-conduit/
But I'm not able to reproduce them when compiling with -O2 --rtsopts (and using GHCRTS=-M20m to limit the size of the heap so that it fails faster in case of a leak) on GHC 9.6.2.
Even after enabling the DuplicateRecordFields, NoFieldSelectors and OverloadedRecordDot triad, record update for ambiguous fields remains a pain, often alleviated with lens libraries like "generic-lens".
I've found tricky to set a vertical scrollbar on a component, when we don't want to set an explicit height in the component itself, and instead want it to consume leftover vertical space from an ancestor that has "height: 100vh;"
I've managed to achieve it by spraying "display: flex" and "flex-grow: 1" across the ancestor chain, but I wonder if there's a better way. 🤔