Note to self: type variables in #purescript and #haskell cannot be bound to partially applied type synonyms.
If you try to do so, in a sufficiently polymorphic way, you'll get very confusing type errors as the checker attempts to solve things with the variable bound to the "head" of the (parametrically expanded) type alias.
Last night it was (forall r. (forall f. Foldable1 f => f a -> r) -> r) and tonight it was (a -> Term a). Introducing a newtype can help, but beware impredicativity.
@eh If you don't have non-purescript dependencies, you might just start with a nix setup for npm. Spago package sets are nix-ish handling for purescript deps.
A great example of how cool PureScript backend optimizer is - The PureScript code makes multiple map and filter calls and also calls into two functions with complicated logic. The generated output shows that the PS code was aggressively inlined into a tiny bit of JS code -
I think next time I might not start in the middle of a large project. Needs to be more like Joy of Painting and start with a blank "canvas". Probably just grab a problem from the cyber-dojo and plug at it.
Let me know if the music is too loud or the font to unreadable.
Bah, #purescript doesn't call it "strict positivity", but it doesn't let me violate that and derive Functor. Sometimes I think the "efficient DeBruijn" of #bound 's Scope gets paid for in programmer time. :blobfoxlaughsweat:
I've got a specific type that uses a #bound approach but I'd like to write some general folds (using e.g. algebra families) instead of duplicating the "traversal" code.
I might have done the categorical approach (functor categories instead of algebra families) before, but that has limitations and I think I lost the code.
Updated my ugly-ass lambda calculus thing on my website (https://www.iguanasuicide.net/) and now you can click the name of the reduction to perform it.
Typed holes (in #purescript or GHC #haskell or wherever) are just too useful. I don't know how to operate in higher-order / heavily polymorphic code without them anymore. :blobfoxgooglyconfused:
Writing a new language is hard... so much to implement before I'm even willing to use it myself! 😜
Anyone know of an interactive "lambda calculus" expression evaluation site? Or something in that UX neighborhood that I should use for inspiration?
I know I used to answer a lot of #haskell questions just by stepping though evaluation. I thought it would be nice to have that on a website and I have a basic expression parser and visualizer in #purescript running on my website ("production" is a buggy version, tho) but need to design interactive stepping.