A reverse linked-list, as an enumeration in Dotty: enum Tsil[+T] { case Lin case Snoc(init: Tsil[T], last: T) }
-
-
Replying to @propensive
I'm confused; a reverse linked list is a singly linked list with the constructor names and arg order reversed?
2 replies 0 retweets 2 likes -
Replying to @jedws
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.
1 reply 0 retweets 0 likes -
Replying to @propensive @jedws
I was mainly trying to demonstrate how simple enum makes the definition in Dotty, though!
1 reply 0 retweets 0 likes -
Replying to @propensive
right, extra stuff just gets in way. although perhaps you missed ‘enum _class_’ ?
1 reply 0 retweets 0 likes -
-
Replying to @propensive
oh, interesting. I was merely looking at the feature proposal
1 reply 0 retweets 0 likes
Replying to @jedws
Aha, that's so much more principled than me! I was just typing random words into the Dotty REPL...
1:33 AM - 18 May 2017
0 replies
0 retweets
1 like
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.