4 ms·
Thanks man, this is great. > since it's the heterogeneous nature that will prevent optimization anyway That was the part I was wondering about. I wanted to se
by urs2102 11y ago
Thanks man, this is great.
> since it's the heterogeneous nature that will prevent optimization anyway
That was the part I was wondering about. I wanted to see if it was possible to do compile time type checking on a list where I don't know what element would be inside.
It was less for optimization and more for experimentation. Like I was trying to see if I approached building a Lisp with OCaml type checking - how much of the "Lisp" would I have to trade to get proper HM type inference. No purpose other than for play.
Then, although I assumed it was naturally impossible, figured I'd ask.
So car can work for type cons, and then that returns the element regardless of type since the first part of the cons that is pulled becomes just the element?