People have been asking how can they use the #Emacs cats package. I've prepared an example of term unification with state monad https://t.co/pVVgRFNq7E and added some more sentences to the readme. If you have questions or some cool examples, share here or on GitHub!
It's rather humbling reading papers from the 80s when people actually already figured all this shit... "but mah typescript" lol no.
One of them I'm heavily adapting is https://t.co/NCUuH9Z7Ai . Good read in general.
Still working on #Emacs#Elsa generic types... the 80/20 applies brutally here (it's rather more like 95/5) :D The 5% I've finished gives you a lot of milage, but the finishing grind is just brutal. Didn't make a single useful commit in 2 weeks, mostly just reading papers...
Slowly working on #emacs#Elsa unification and generics, now we can detect infinite substitution cycles. Once generics are in we are very close to a 1.0 release, it's *the* killer feature that is missing.
(the monad interface is from https://t.co/UjWNQ8Qzzb)
@bbatsov I always assumed you were from Sofia ๐ We were in VT last summer for 8 days, it's a rad town! The old town is just gorgeous (I actually confused it in my head with Old Plovdiv ๐คฆโโ๏ธcouple times since I've been in both more than once)
The cats are alive! https://t.co/UjWNQ8Qzzb #emacs#haskell#elisp#monads#whoa
This is the library which is used in https://t.co/jEsvEJJmfb and will be used in Elsa soon to implement polymorphism (as soon as I put it on melpa or somewhere where people could grab it)
I'm starting a blog series on functional programming in #Emacs and #Elsa. The first part on functors is live https://t.co/jEsvEJJmfb
There is a library being developed that will encapsulate a lot of the stuff from the series, I will publish it shortly as well :)
I'm adding generic types to #Emacs#Elsa but got distracted implementing monads :D
On the left is the implementation of bind for the substitution monad (kind of a MaybeT State), on the right is the polytype instantiation and a bit of unification code. Not a trivial example!
Before I was "hand rolling" the propagation of all the effects and the code was incredibly messy. With the monadic interface you can see unification or instantiation is mostly just "walking the monad over the type structure". Super simple!
@jwiegley Indeed, it's the printer being "clever" and still showing me 'foo in edebug :/ I feel dumb asking this now. And yes you guessed it I'm implementing monads to do type unification for Elsa :D Actually works surprisingly well in Elisp (except "return" can't infer types but well...)
#Emacs Please someone explain this to me
(defmacro my-foobar (x)
(if (symbolp x) "yes" "no"))
(my-foobar 'my-function) ;; => "no"
How??? I hope this is something dumb because I *really* need it to work :D