Hello all. I published a GIST (internal use at thi...
# arrow
p
Hello all. I published a GIST (internal use at this stage but public in a near future) about my attempt to write a short DSL with Λrrow Free ! In the future, I'll write more articles for my team to feel better with Λrrow. What do you think about this format ? Feedback are wellcome to improve this draft... Thx to Λrrow team members for their help 😍 https://gist.github.com/PBastiani/26d8734ff33001cb0304df337ea936a1
👌🏽 4
r
This is excellent @PhBastiani
I’d love to see that in the Free section in the arrow docs
The actual class header kdoc for the Free documentation which is currently inexistent
p
Copy code
fun <A> update(key: String, f: (A) -> A) : Free<ForKVStoreA, Unit> =
  fx.monad {
    val (vMaybe) = get<A>(key)
    vMaybe.fold(
      { !FreeKVStore.just() }, // ifEmpty
      { !put(key, f(it)) }
    )
    Unit
  }.fix()
That suspension in the inlined fold lol I thought we had deprecated the destructuring syntax for 0.10
p
Smell code (inlined code trap). Fixed Thx Paco. @raulraja yes you can integrate this gist into the doc... To be public, a proofreading is still necessary !