juan_gandhi: (VP)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote2014-03-10 10:56 am
Entry tags:

introduced a constant

(fixed)

type Outcome = Result[Any]

val OK:Outcome = Good("OK")


Turned out, have tons of it everywhere. Weird actually.

And no, I'm not saying it's good. I'm just seeing a pattern that worries me a little bit, but I don't know why.

E.g.
  def executeJS(js: String): Result[Unit] = runJS(js) map asScala filter
    ("OK"==, wrong => s"Wrong response from browser: <<$wrong>>")

[identity profile] ivan-gandhi.livejournal.com 2014-03-10 08:45 pm (UTC)(link)
Вот это-то меня и смущает.

Есть два варианта - один - Good(content), другой - "всё хорошо"; я бы написал Good[Unit]... да впрочем, вот и ответ, наверное.