3 ms·
It's funny to see that singleton types are within the highest level: 'expert'. While in Typescript they're, together with union types, the most intuïtive thing
by joostdevries 10y ago
It's funny to see that singleton types are within the highest level: 'expert'. While in Typescript they're, together with union types, the most intuïtive thing ever.
I guess that's because to express them in a language that doesn't have native support requires advanced deftness in typelevel programming. Like f.i. implementing them yourself in Scala 2.x.
So I expect the coolness factor of singleton types and union types to fall precipitously as soon as Scala 3.x/Dotty becomes prevalent. They'll be 'just' a powerful feature that everybody understands and uses all the time.
- sleexyz 10y agowrong "singletons" http://stackoverflow.com/questions/16017294/singleton-types-in-haskell http://stackoverflow.com/questions/16017294/singleton-types-... Singletons are a way to emulate dependent types with typeclasses, datakinds, and GADTs
- joostdevries 10y agoNo it isn't http://www.slideshare.net/yoozd/union-types-and-literal-singleton-types-in-scala-and-typescript http://www.slideshare.net/yoozd/union-types-and-literal-sing...