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

the right stuff

presentation: http://2013.flatmap.no/blakstad.html
unfiltered library: https://github.com/unfiltered/unfiltered/blob/master/directives/README.markdown

So, the idea is, have all this http run monadic; that includes checking conditions and throwing back all those 404s, 451, 500...

[identity profile] ivan-gandhi.livejournal.com 2014-03-08 09:58 pm (UTC)(link)
В скалазеде есть Validation, но она непрактична.

[identity profile] mikkim08.livejournal.com 2014-03-09 03:12 pm (UTC)(link)
Может scala.util.Try тогда ? Хоть он и не монада. Я сейчас посмотрел, у нас пишут в таком стиле:
val handle: Response => Try[Value] = { resp =>
  ...
  for {
     - <- isOk(resp)  // returns Try
     - <- isJSON(resp) // returns Try
     result <- getResult(resp)
  } yield result
}
Edited 2014-03-09 15:16 (UTC)

[identity profile] ivan-gandhi.livejournal.com 2014-03-09 04:54 pm (UTC)(link)
Да, вот и я так хочу писать.