2 ms·
Got sucked into reading the article because of the "didn't go as planned" but it left my thirst for failure stories unquenched. Should have known. That aside,
by stareatgoats 4y ago
Got sucked into reading the article because of the "didn't go as planned" but it left my thirst for failure stories unquenched. Should have known.
That aside, that thing with opaque types in Scala sounds interesting - but how would the compiler know that the parameter was a UserId and not just a random string?
- lmm 4y agoYou have to explicitly call something like UserId(...), just like with any other type. (You can actually do this technique in C by using a 1-element struct, although it's a lot more cumbersome than Scala since the type system is so much more limited).
- epolanski 4y agoI guess there is a constructor string -> UserID