14 years into Scala, I'm experimenting with a new way of formatting my code. I've started column-aligning each opening `(` of explicit/implicit parameter block, and the `:` of the return type in method/class definitions, with a four-space indent for long lines. Liking it so far.
-
Show this thread
-
6 replies 2 retweets 7 likesShow this thread -
Replying to @propensive
What is that return type, with the pipes and the tilde?
1 reply 0 retweets 0 likes -
Replying to @loewenheim
It's a monad, a bit like `Try`, which encodes all possible error types, a bit like typelevel checked exceptions. The pipes are aliases which construct an intersection type, which allows the types to match if they're reordered.
2 replies 0 retweets 1 like -
Replying to @propensive @loewenheim
It means that I'm forced to handle all those error types. The tilde is a way of keeping a working set-algebra on the types, covering the case where the set of types may be empty.
1 reply 0 retweets 1 like -
Replying to @propensive @loewenheim
I'd love a gist or a tiny blog post with your Result error encoding
1 reply 0 retweets 0 likes
Ok, ok! the source code for `Result` is here: https://github.com/propensive/mitigation/blob/master/src/core/mitigation.scala …
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.