juan_gandhi: (VP)
[personal profile] juan_gandhi
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...

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

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

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 234567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 4th, 2025 11:41 pm
Powered by Dreamwidth Studios