A reverse linked-list, as an enumeration in Dotty: enum Tsil[+T] { case Lin case Snoc(init: Tsil[T], last: T) }
Yeah, it's exactly how you describe it (though the names aren't special). Structurally the same, but biased to make appends seem at the end.
-
-
I was mainly trying to demonstrate how simple enum makes the definition in Dotty, though!
-
right, extra stuff just gets in way. although perhaps you missed ‘enum _class_’ ?
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.