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-08 06:28 pm (UTC)
From: [identity profile] mikkim08.livejournal.com
Да, с Either не очень удобно. Может, в scalaz есть другой, более удобный, вариант ? Надо будет посмотреть. Но так или иначе, general-purpose Result в узкоспециальной библиотеке мне как-то не очень.

Про директивы есть другое видео : http://2013.flatmap.no/teigen.html

(может, с'ездить в мае на эту конференцию ? регистрация 2К стоит)
Edited Date: 2014-03-08 06:29 pm (UTC)

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

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

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
181920 21 222324
25 262728 2930 31

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 1st, 2025 12:57 pm
Powered by Dreamwidth Studios