Fork me on GitHub
#funcool
<
2016-05-31
>
rm07:05:45

hi all. Can someone explain this:

(alet [a (ei/right 1) b (inc a)] a)
2
Why not 1 or #<Right 1> ?

rm07:05:35

But

(alet [a (ei/right 1) b (ei/right 2)] a)
#<Right 1>

rm07:05:15

because (inc a) is 2, not #<Right 2> and doesn't have context. I remember someone (probably niwinz) already explained this to me

niwinz07:05:53

at this moment it seems like inconsistent

niwinz07:05:21

and it seems like a bug 😞

niwinz07:05:13

this additionally remember me that I should release a new version of cats ASAP

niwinz07:05:28

because master comes with many bugfixes

niwinz07:05:33

@rm the behavior differs because some different paths are taken for evaluate that

niwinz07:05:07

if one expresion depends on other is evaluated differently if the both are just parallel paths

rm07:05:56

@niwinz: thank you for explanation again, will wait for a new version. But actually it's very rare case that I use something like that, most of the time all results of functions are wrapped already

lmergen08:05:52

anyone here that is familiar with suricatta? i'm running into issues while trying to UPDATE ... SET key = NULL -- apparently, jooq tries to cast the null value to a varchar

lmergen08:05:31

so I was thinking that there perhaps was some clojure <-> java incompatibility that jooq uses to test for null ?

niwinz08:05:53

I was found the same issue some days ago but I don't k now if I can solve it from suricatta part

lmergen08:05:06

i can help you with it, if you want

lmergen08:05:19

this is a real issue for me now, so it makes sense for me to spend some time debugging it

niwinz08:05:38

any help is very welcome!

lmergen08:05:56

apparently (fmt/sql) returns SET foo = NULL, where (fmt/sqlvec) return SET foo = (CAST null AS CHARACTER VARYING)

niwinz08:05:27

seems like a dialect issue..?

lmergen08:05:34

yes, probably

lmergen08:05:51

the problem goes away when you get rid of the pgsql dialect

niwinz08:05:14

hmm, if it works properly with default dialect, but when a connection is used with postgresql dialect it does not works

niwinz08:05:18

it seems like a jOOQ bug

lmergen08:05:25

i agree with that

lmergen08:05:58

i wouldn't expect a bug like this to be in jOOQ, however

lmergen08:05:06

it's too major a bug

niwinz08:05:00

user=> (fmt/sqlvec (-> (dsl/update :foo) (dsl/set :foo nil)))
["update foo set foo = ?" nil]
user=> (fmt/sqlvec (-> (dsl/update :foo) (dsl/set :foo nil)) {:dialect :postgresql})
["update foo set foo = cast(? as varchar)" nil]

niwinz08:05:32

I going to write in the jOOQ mailing list

lmergen08:05:53

ok, awesome!

niwinz08:05:46

I'll notice you on any news on that 😉

lmergen09:05:02

awesome! i'll create an issue on the suricatta repo to keep track of this