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.
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
"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.
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/
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.
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?
@koz I would like to see such a comparison post too. In the meantime I found this stackoverflow question which contains a way to do it using an ML functor: https://stackoverflow.com/questions/48989663/monads-and-sml-modules. The obvious downside is that you have to explicitly state which monad to use at some point.
Another lesser known difference is that I believe you can't instantiate an ML signature with a polymorphic type. For example you can't write an instance of that MAPPABLE signature for a type like Map k v. At least not such that it is still polymorphic over the key type k.
@koz Not quite your case, but “The next 500 module systems” paper gives a nice overview of the problem, bridging modules, type classes and records (and scopes!).