Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-24 08:36:55 × dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 256 seconds)
2021-03-24 08:37:16 <bahamas> the library you're talking about sounds familiar (although I don't remember the name). however, I fear it uses too many abstractions, which might not be necessary for what I'm trying to do
2021-03-24 08:38:19 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 08:38:20 idhugo joins (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net)
2021-03-24 08:38:28 <bahamas> I have another question. I see some warnings regarding automatic deriving "No deriving strategy specified. Did you want stock, newtype, or anyclass?
2021-03-24 08:38:59 hiroaki joins (~hiroaki@2a02:8108:8c40:2bb8:a7dd:a3bb:c8b0:2d88)
2021-03-24 08:39:01 <bahamas> do I have to specify the strategy on each deriving declaration, or is there a different approach?
2021-03-24 08:39:07 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Remote host closed the connection)
2021-03-24 08:39:51 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 08:40:14 borne joins (~fritjof@200116b8644f8c00bc09546e2ac68572.dip.versatel-1u1.de)
2021-03-24 08:40:48 Boomerang joins (~Boomerang@2a05:f6c7:2179:0:f97c:9426:ef00:f528)
2021-03-24 08:40:49 <ski> <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/deriving_strategies.html>
2021-03-24 08:41:32 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Client Quit)
2021-03-24 08:42:21 dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2021-03-24 08:42:27 ph88_ joins (~ph88@2a02:8109:9e00:7e5c:4978:201f:ec35:67e9)
2021-03-24 08:43:39 kuribas joins (~user@ptr-25vy0i8r3m7ulrlbw64.18120a2.ip6.access.telenet.be)
2021-03-24 08:44:02 <ski> i guess the laste paragraph on that page applies in your case, and you then have to explicitly specify the strategies in which there's an ambiguity reported
2021-03-24 08:45:38 xourt joins (d4c620ea@212-198-32-234.rev.numericable.fr)
2021-03-24 08:47:07 × frozenErebus quits (~frozenEre@94.128.81.87) (Ping timeout: 256 seconds)
2021-03-24 08:47:10 × dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 256 seconds)
2021-03-24 08:47:25 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 08:48:30 <bahamas> ski: I'm deriving Show and Generic for a record and a sum type
2021-03-24 08:48:42 maroloccio_ joins (~marolocci@pousada3ja.mma.com.br)
2021-03-24 08:49:01 <bahamas> so none of them are a newtype. I'm assuming the warning shows up, because I have GeneralizedNewtypeDeriving enabled
2021-03-24 08:50:09 <bahamas> ok, this is just a warning, so I'll ignore it for now
2021-03-24 08:51:07 <ski> so the ambiguity is between `stock' and `anyclass', for `Show', i think
2021-03-24 08:51:09 heatsink joins (~heatsink@2600:1700:bef1:5e10:b09b:3609:dd4b:42c9)
2021-03-24 08:51:19 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Client Quit)
2021-03-24 08:52:01 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 08:52:34 <ski> hm
2021-03-24 08:54:39 <bahamas> I have a question regarding records and json. I know that one pattern is to prefix each record field to prevent clashes. for example data User = { uName :: Text, uAge :: Int }. but the incoming json is usually { name: "foo", age: 26 }. is there a way to handle this automatically?
2021-03-24 08:55:50 × heatsink quits (~heatsink@2600:1700:bef1:5e10:b09b:3609:dd4b:42c9) (Ping timeout: 264 seconds)
2021-03-24 08:55:55 kritzefitz joins (~kritzefit@p548c9398.dip0.t-ipconnect.de)
2021-03-24 08:56:01 <kuribas> bahamas: the duplicaterecordfields extension
2021-03-24 08:56:38 <kuribas> bahamas: And if you use that, the namedFieldPuns and recordWildCards extensions are very handy.
2021-03-24 08:56:48 <kuribas> Because it makes manipulating records much easier.
2021-03-24 08:56:50 thc202 joins (~thc202@unaffiliated/thc202)
2021-03-24 08:57:30 ubert joins (~Thunderbi@p200300ecdf25d975e6b318fffe838f33.dip0.t-ipconnect.de)
2021-03-24 08:57:51 frozenErebus joins (~frozenEre@94.128.81.87)
2021-03-24 08:58:12 <xsperry> IIRC json will handle it automatically if your field names start with data name. so data User = { userName :: Text, userAge :: Int }
2021-03-24 08:58:25 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Quit: ლ(ಠ益ಠლ) .:. <Ashley> my porn is hidden in a folder called "BBC Micro Emulator")
2021-03-24 08:58:40 <kuribas> bahamas: or alternatively you can also use a conversion function in the genericToJSON
2021-03-24 08:58:53 <kuribas> xsperry: that's not automatic, you need to write it yourself.
2021-03-24 08:59:06 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 09:00:07 × MichaelHoffmannb quits (brisadmozi@gateway/shell/matrix.org/x-cvnnmjtfpdwpnugh) (Quit: Idle for 30+ days)
2021-03-24 09:00:28 <kuribas> bahamas: https://hackage.haskell.org/package/aeson-1.5.6.0/docs/Data-Aeson.html#v:fieldLabelModifier
2021-03-24 09:00:43 <bahamas> kuribas: yeah. that's my current solution
2021-03-24 09:01:02 <kuribas> bahamas: then what is the question?
2021-03-24 09:01:07 <bahamas> kuribas: that involves copying a JsonUtils file in all projects. I was wondering if someone abstracted this
2021-03-24 09:01:11 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Client Quit)
2021-03-24 09:01:20 <kuribas> JsonUtils?
2021-03-24 09:01:24 <kuribas> it's part of Aeson
2021-03-24 09:01:33 <bahamas> kuribas: that's just how I named the file
2021-03-24 09:01:40 <kuribas> And how much more abstraction do you want then genericToJSON?
2021-03-24 09:02:06 <kuribas> you can always write, myCustomToJSON = genericToJSON optionOverrides
2021-03-24 09:02:09 <bahamas> kuribas: https://bpa.st/DLGA
2021-03-24 09:02:23 <bahamas> this is my current implementation
2021-03-24 09:03:00 <kuribas> bahamas: and?
2021-03-24 09:03:05 <kuribas> I don't see the problem
2021-03-24 09:03:11 <bahamas> hey, I was just wondering if anybody did this. maybe it's not general enough or maybe it's not worth making a library out of it
2021-03-24 09:03:21 <bahamas> it's ok if that's the case. I just thought I'd ask
2021-03-24 09:03:48 Franciman joins (~francesco@host-79-53-62-46.retail.telecomitalia.it)
2021-03-24 09:05:01 <kuribas> that would be very useful IMO...
2021-03-24 09:05:06 <kuribas> wouldn't
2021-03-24 09:05:15 <kuribas> it's fairly easy to implement
2021-03-24 09:06:00 wonko7 joins (~wonko7@45.15.17.60)
2021-03-24 09:06:03 <bahamas> sure. at the same time, I think the pattern of prefixing labels with lowercase letters is widespread. so it could be an alternative option provided by aeson
2021-03-24 09:06:16 <bahamas> but I don't have strong feelings for this. it's just a thought
2021-03-24 09:07:02 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 09:07:40 × Cale quits (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) (Ping timeout: 276 seconds)
2021-03-24 09:07:44 LKoen joins (~LKoen@194.250.88.92.rev.sfr.net)
2021-03-24 09:08:57 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Client Quit)
2021-03-24 09:09:46 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 09:09:55 × fuzzypixelz quits (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Ping timeout: 265 seconds)
2021-03-24 09:13:34 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
2021-03-24 09:14:21 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 264 seconds)
2021-03-24 09:20:37 × lupulin quits (~lupulo@163.117.64.56) (Remote host closed the connection)
2021-03-24 09:21:03 hidedagger joins (~nate@unaffiliated/hidedagger)
2021-03-24 09:21:07 __minoru__shirae joins (~shiraeesh@46.34.207.185)
2021-03-24 09:21:55 darjeeling_ joins (~darjeelin@122.245.208.187)
2021-03-24 09:22:44 fuzzypixelz joins (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
2021-03-24 09:22:52 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Quit: ლ(ಠ益ಠლ) .:. <Ashley> my porn is hidden in a folder called "BBC Micro Emulator")
2021-03-24 09:24:21 × kiweun quits (~kiweun@2607:fea8:2a62:9600:d4ca:3dbb:1110:af82) (Remote host closed the connection)
2021-03-24 09:24:25 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 09:26:04 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Client Quit)
2021-03-24 09:26:09 × arianvp quits (~weechat@arianvp.me) (Ping timeout: 244 seconds)
2021-03-24 09:27:01 is_null joins (~jpic@pdpc/supporter/professional/is-null)
2021-03-24 09:28:15 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 09:28:21 arianvp joins (~weechat@arianvp.me)
2021-03-24 09:29:45 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Remote host closed the connection)
2021-03-24 09:30:24 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 09:31:00 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Remote host closed the connection)
2021-03-24 09:31:39 Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck)
2021-03-24 09:31:53 × azure1 quits (~azure@103.154.230.130) (Ping timeout: 256 seconds)
2021-03-24 09:32:55 azure1 joins (~azure@103.154.230.130)
2021-03-24 09:34:15 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-24 09:36:48 GZJ0X__ joins (~gzj@unaffiliated/gzj)
2021-03-24 09:37:09 × kritzefitz quits (~kritzefit@p548c9398.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2021-03-24 09:37:28 kritzefitz joins (~kritzefit@2003:5b:203b:200::10:49)
2021-03-24 09:39:46 × GZJ0X_ quits (~gzj@unaffiliated/gzj) (Remote host closed the connection)

All times are in UTC.