Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,804,098 events total
2021-08-18 04:52:54 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-08-18 04:54:51 Sgeo joins (~Sgeo@user/sgeo)
2021-08-18 04:55:54 <nerdypepper> hiya o/, is there a parser library for haskell that can help produce loseless syntax trees? something like rowan for rust: https://github.com/rust-analyzer/rowan
2021-08-18 04:56:43 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 268 seconds)
2021-08-18 05:01:13 <lechner> int-e: unfortunately, i have no idea where to stick that Only https://paste.debian.net/1208074/
2021-08-18 05:01:14 <Axman6> what does a "lossless syntax tree" mean?
2021-08-18 05:02:11 <Axman6> lechner: Only is for the results, not the arguments
2021-08-18 05:03:02 <nerdypepper> Axman6: it preserves whitespace, comments etc., a more common term is concrete syntax tree. the idea is you can reproduce the source text from the syntax tree
2021-08-18 05:03:35 <Axman6> you could definitely do that with any of the parser libraries I would think
2021-08-18 05:05:56 <nerdypepper> Axman6: oh yeah for sure, you can still preserve whitespace tokens etc. i was hoping to find a library that does the necessary performance optimizations for you (like rowan).
2021-08-18 05:06:33 <nerdypepper> rowan explicitly tries to avoid allocating every single token by interning whitespace and sharing structurally similar subtrees etc.
2021-08-18 05:07:26 <int-e> It's needed for the outer tuple, I think. Only (Values [blah,blub])
2021-08-18 05:07:53 × argento quits (~argent0@168-227-97-23.ptr.westnet.com.ar) (Quit: leaving)
2021-08-18 05:09:31 <Axman6> edwardk: do you have any thoughts on nerdypepper's question? It feels like trifecta/parsers should be able to do this for you, but I'm not familliar enough to say for sure
2021-08-18 05:10:36 <int-e> nerdypepper: And I think it wants ByteString or Text, never String.
2021-08-18 05:11:32 <lechner> int-e: it seems a step closer, perhaps https://paste.debian.net/1208075/
2021-08-18 05:12:16 <int-e> sorry for picking the wrong nick all the time :-/
2021-08-18 05:15:21 <Axman6> lechner: why are you using Values?
2021-08-18 05:15:31 <Axman6> it seems like you're really complicating things more than they need to be
2021-08-18 05:15:48 <lechner> please go ahead
2021-08-18 05:15:55 <iqubic> I see that #haskell survived the transition to Libera. That's good to see.
2021-08-18 05:16:01 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
2021-08-18 05:16:17 <lechner> Axman6: 'semver' cast, maybe?
2021-08-18 05:16:28 <int-e> Well, the ToField Char indicates that it used a ToField a => ToRow [a] instance to get at ToRow String, so something went wrong apart from not using ByteString or Text (the string should be a field, not a row)
2021-08-18 05:16:40 × Seby quits (~Seby@115.98.232.63) (Ping timeout: 240 seconds)
2021-08-18 05:16:41 <Axman6> oh actually... I hadn't looked at the query very closely
2021-08-18 05:17:13 <Axman6> iqubic: irc is just a medium, #haskell will never die
2021-08-18 05:17:18 × Vajb quits (~Vajb@hag-jnsbng11-58c3ab-85.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-08-18 05:17:25 <iqubic> That's good to know.
2021-08-18 05:17:34 int-e isn't fully following either.
2021-08-18 05:17:58 <lechner> Axman6: it's also an antijoin via EXCEPT
2021-08-18 05:19:03 <int-e> lechner: Quite possibly the strings also need Only. And by ByteString or Text, not String.
2021-08-18 05:19:14 <int-e> s/by/be/
2021-08-18 05:19:33 <Axman6> ok I can see now what you were trying to do but I have no idea how it's supposed to be done
2021-08-18 05:19:45 <lechner> without Only from the strings https://paste.debian.net/1208076/
2021-08-18 05:20:32 <lechner> Axman6: it's a value transfer issue. i could also use JSON
2021-08-18 05:20:34 <int-e> lechner: Only turns a field into a row.
2021-08-18 05:21:03 <int-e> and there is a ToField instance for Text.
2021-08-18 05:21:13 <Axman6> Have you tried `(Values ["semver"] [Only ("2.1.6" :: ByteString)])`?
2021-08-18 05:21:25 <Axman6> or Text?
2021-08-18 05:21:38 <int-e> Axman6: We're getting there. You also need Only on the outside.
2021-08-18 05:22:32 <lechner> that compile, with Text
2021-08-18 05:22:37 <lechner> compiled
2021-08-18 05:23:01 <Axman6> so all good?
2021-08-18 05:23:11 <Axman6> does the query run??? :o
2021-08-18 05:23:47 <lechner> the query isn't working
2021-08-18 05:23:58 <Axman6> now for the fun part :P
2021-08-18 05:24:38 <lechner> the query is tested; and this is the second time around
2021-08-18 05:26:05 <lechner> i can probably use PGArray with unnest or a JSON string but VALUES seemed so easy
2021-08-18 05:30:12 <edwardk> Axman6: context?
2021-08-18 05:30:16 <edwardk> *reading back*
2021-08-18 05:30:31 <Axman6> see message at XX:55
2021-08-18 05:30:39 <edwardk> lossless parsing?
2021-08-18 05:30:39 <lechner> what does the "fat" arrow here mean, please? https://hackage.haskell.org/package/postgresql-simple-0.6.4/docs/Database-PostgreSQL-Simple.html#v:formatQuery
2021-08-18 05:31:05 <Axman6> it's a type class constraint
2021-08-18 05:31:24 <Axman6> saying that q must be an instance of the ToRow class
2021-08-18 05:31:59 <edwardk> i usually wind up building a parser for whitespace that captures everything inside the whitespace and then make sure my syntax trees are very close to the surface language syntax with little whitespace bins in the tree wherever spaces could occur. this works until you need layout and then regenerating the tree has some extra consistency crap it has to satisfy.
2021-08-18 05:32:24 <edwardk> but i don't know a general purpose 'exactprint' style library
2021-08-18 05:32:53 <edwardk> (whitespace here includes comments, etc.)
2021-08-18 05:32:59 <dibblego> we started writing one aaaaages ago
2021-08-18 05:32:59 Axman6 awaits the nerdsnipe to kick in...
2021-08-18 05:33:20 <edwardk> not happening. groq's keeping me busy this month and i just bought a house and am moving =)
2021-08-18 05:33:33 <Axman6> 'grats!
2021-08-18 05:34:10 iqubic` joins (~user@2601:602:9502:c70:b7f7:ce5b:5e25:126d)
2021-08-18 05:34:19 iqubic` parts (~user@2601:602:9502:c70:b7f7:ce5b:5e25:126d) ()
2021-08-18 05:34:53 Vajb joins (~Vajb@hag-jnsbng11-58c3ab-85.dhcp.inet.fi)
2021-08-18 05:38:10 × iqubic quits (~user@2601:602:9502:c70:b7f7:ce5b:5e25:126d) (Ping timeout: 240 seconds)
2021-08-18 05:40:11 <cdsmith> Does this exist somewhere? data ReifiedInstance (cls :: Type -> Constraint) (a :: Type) where ReifiedInstance :: cls a => ReifiedInstance cls a
2021-08-18 05:42:56 <nerdypepper> Axman6: thanks for the mention, trifecta looks great, i will take a look at that. it would be a pretty mega project to rewrite something like rowan, but i am not opposed to trying that out either!
2021-08-18 05:43:11 <hsek[m]> Are there resources for me to read regarding separating API types from the DB types in `servant`? I don't really understand why because it seems really convenient. But I know that a lot of people advocate against it. https://old.reddit.com/r/haskell/comments/p64g1q/servantutil_extending_servant_with_database/h9bbpaa/
2021-08-18 05:44:11 × fabfianda quits (~fabfianda@mob-5-91-112-128.net.vodafone.it) (Ping timeout: 268 seconds)
2021-08-18 05:49:44 × Gurkenglas_ quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Ping timeout: 268 seconds)
2021-08-18 05:51:34 × ablutor quits (~quassel@wasscher.com) (Quit: going for vitamine d)
2021-08-18 05:51:51 ablutor joins (~quassel@wasscher.com)
2021-08-18 05:52:07 <cdsmith> hsek: Can't point to a document, but APIs have different compatibility constraints. They might start out looking similar to backend data, but over time, you'll want to migrate your storage schemas, while APIs must stay the same. That's hard to handle if they are the same type.
2021-08-18 05:55:56 favonia joins (~favonia@user/favonia)
2021-08-18 05:59:25 × ozzymcduff quits (~mathieu@81-234-151-21-no94.tbcn.telia.com) (Remote host closed the connection)
2021-08-18 06:02:28 ozzymcduff joins (~mathieu@81-234-151-21-no94.tbcn.telia.com)
2021-08-18 06:02:39 <hsek[m]> I see, thanks Chris Smith !
2021-08-18 06:02:41 × arahael quits (~arahael@124.170.238.106) (Ping timeout: 248 seconds)
2021-08-18 06:03:10 × falafel quits (~falafel@2601:483:4e00:2b20:e0f3:c7c1:91ca:fe6e) (Ping timeout: 240 seconds)
2021-08-18 06:03:32 wallymathieu joins (~wallymath@81-234-151-21-no94.tbcn.telia.com)
2021-08-18 06:04:43 Obo joins (~roberto@h-46-59-103-134.A498.priv.bahnhof.se)
2021-08-18 06:06:34 <lechner> int-e Axman6: it was the stupidest of all errors. the function was not called. anyway, now I have a runtime type error: Incompatible {errSQLType = "semver", errSQLTableOid = Nothing, errSQLField = "lintian_version", errHaskellType = "Text", errMessage = "types incompatible"}
2021-08-18 06:07:31 <lechner> but it's quite late here. thank you both for your help so far!
2021-08-18 06:10:17 ubert joins (~Thunderbi@91.141.56.213.wireless.dyn.drei.com)
2021-08-18 06:12:03 arahael joins (~arahael@203.221.97.63)
2021-08-18 06:16:43 × echoreply1 quits (~echoreply@2001:19f0:9002:1f3b:5400:ff:fe6f:8b8d) (Quit: WeeChat 2.8)
2021-08-18 06:17:01 Seby joins (~Seby@115.98.232.63)
2021-08-18 06:17:46 × Seby quits (~Seby@115.98.232.63) (Client Quit)
2021-08-18 06:17:50 vysn joins (~vysn@user/vysn)
2021-08-18 06:18:03 echoreply joins (~echoreply@45.32.163.16)
2021-08-18 06:18:10 chomwitt joins (~chomwitt@2a02:587:dc0c:e200:12c3:7bff:fe6d:d374)
2021-08-18 06:20:04 × wallymathieu quits (~wallymath@81-234-151-21-no94.tbcn.telia.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-08-18 06:22:45 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
2021-08-18 06:25:16 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-18 06:28:47 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 245 seconds)
2021-08-18 06:32:47 × aegon quits (~mike@174.127.249.180) (Quit: Lost terminal)
2021-08-18 06:37:43 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-08-18 06:41:19 × smitop quits (~smitop@user/smitop) (Remote host closed the connection)

All times are in UTC.