2014-04-22

juan_gandhi: (VP)
2014-04-22 02:48 pm
Entry tags:

just figured I need this

And can't figure out why I did not need it before

  type Outcome = Result[Any]

  object OK extends Good('OK) with Outcome

  def fold(results:Traversable[Outcome]):Outcome = ((OK:Outcome) /: results)(_<*>_) map (_ => 'OK)


What happens here. I have a type for a result which value I don't care about; any result can be an Outcome.
Now I have a sequence of outcomes; I need just one, OK if everything's ok, or a list of errors.

So there. I just fold results, using tensor product, aka merge, merging the whole sequence into just one value.
juan_gandhi: (VP)
2014-04-22 03:20 pm

я правильно понимаю, что...

http://nnils.livejournal.com/ и http://vk.com/id71921051 врет, что живет в Запорожье? Ростов на Дону, наверное.
Впрочем, она мне не кажется психически здоровой.