pakoito
08/30/2019, 10:43 AM!put("A", 1)
is called. We know it never reaches the interpreter.PhBastiani
08/30/2019, 12:49 PMval test = KVStoreA.put("aa", 1)
.flatMap {KVStoreA.get<Int>("aa")}
.run(interpreterState, State().monad()).fix()
.runS (emptyMap<String, Int>())
println("test -> $test")
test -> {aa=1}
So, flatMap works as expected...PhBastiani
08/30/2019, 1:28 PMrunA
throws a class cast exception ! but it's an other problem...pakoito
08/30/2019, 2:19 PMpakoito
08/30/2019, 2:19 PMPhBastiani
08/30/2019, 2:26 PMpakoito
08/30/2019, 2:55 PMpakoito
08/30/2019, 2:55 PMpakoito
08/30/2019, 2:55 PMpakoito
08/30/2019, 2:55 PMpakoito
08/30/2019, 2:56 PMPhBastiani
08/30/2019, 10:42 PMis KVStoreA.Get<*> -> State().inspect { it : Map<String, Any?> -> Option.fromNullable(it[op.key]) }
val test =KVStoreA.put("aa", 1)
.flatMap {KVStoreA.get<Int>("aa")}
.run(interpreterState, State().monad()).fix()
.runA(emptyMap<String, Int>())
println("test -> $test")
gives test -> Some(1)
=> Each case of the natural transformation should be typed !
The behavior of the compilo is strange 🙃PhBastiani
08/30/2019, 10:46 PMval a = !put("A", 1)
… i've no compilator on handpakoito
08/30/2019, 10:55 PMpakoito
08/30/2019, 10:58 PMUnit
and Option<Int>
pakoito
08/30/2019, 10:59 PMPhBastiani
08/30/2019, 11:04 PMPhBastiani
09/01/2019, 10:47 AMfix()
was missing before the call of run(initialtstate)
. Thx for your help.PhBastiani
09/01/2019, 12:16 PMrun
was not applied on the right object.
I will dig to understand the non execution of the program without fix
pakoito
09/01/2019, 3:41 PMrun
function from kotlinpakoito
09/01/2019, 3:42 PMrun
member function that you expectedpakoito
09/01/2019, 3:42 PMPhBastiani
09/01/2019, 7:01 PMPhBastiani
09/01/2019, 7:09 PMInject
and try to compose DSL ...pakoito
09/01/2019, 8:25 PMpakoito
09/01/2019, 8:25 PMPhBastiani
09/02/2019, 8:02 AMTuple2