Logs: liberachat/#haskell
| 2021-07-30 00:31:46 | × | Atum_ quits (~IRC@user/atum/x-2392232) (Quit: Atum_) |
| 2021-07-30 00:37:14 | → | euouae joins (~euouae@user/euouae) |
| 2021-07-30 00:44:38 | → | averell joins (~averell@user/averell) |
| 2021-07-30 00:45:40 | × | haritz quits (~hrtz@user/haritz) (Ping timeout: 268 seconds) |
| 2021-07-30 00:50:36 | × | alx741 quits (~alx741@181.196.69.85) (Quit: alx741) |
| 2021-07-30 00:51:15 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:1557:b33d:ca8c:dfa4) (Remote host closed the connection) |
| 2021-07-30 00:51:49 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:1557:b33d:ca8c:dfa4) |
| 2021-07-30 00:56:20 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:1557:b33d:ca8c:dfa4) (Ping timeout: 250 seconds) |
| 2021-07-30 00:56:25 | → | mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) |
| 2021-07-30 00:57:14 | × | ukari quits (~ukari@user/ukari) (Remote host closed the connection) |
| 2021-07-30 00:58:03 | → | ukari joins (~ukari@user/ukari) |
| 2021-07-30 00:58:24 | → | haritz joins (~hrtz@62.3.70.206) |
| 2021-07-30 00:58:25 | × | haritz quits (~hrtz@62.3.70.206) (Changing host) |
| 2021-07-30 00:58:25 | → | haritz joins (~hrtz@user/haritz) |
| 2021-07-30 01:01:04 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:1557:b33d:ca8c:dfa4) |
| 2021-07-30 01:01:05 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:1557:b33d:ca8c:dfa4) (Remote host closed the connection) |
| 2021-07-30 01:01:38 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:1557:b33d:ca8c:dfa4) |
| 2021-07-30 01:01:40 | → | doyougnu joins (~user@c-73-25-202-122.hsd1.or.comcast.net) |
| 2021-07-30 01:03:10 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 265 seconds) |
| 2021-07-30 01:03:27 | × | Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Ping timeout: 245 seconds) |
| 2021-07-30 01:05:18 | <lechner> | Hi, is it possible to use Aeson's omitNothingFields in this example without a parameterized type? Thanks! https://hackage.haskell.org/package/aeson-1.5.6.0/docs/Data-Aeson.html#v:omitNothingFields |
| 2021-07-30 01:05:42 | → | retroid_ joins (~retro@5ec19a54.skybroadband.com) |
| 2021-07-30 01:07:11 | <Axman6> | lechner: I'm not sure what you mean |
| 2021-07-30 01:08:47 | <lechner> | i think i have an import problem: ‘toJSON’ is not a (visible) method of class ‘ToJSON’ |
| 2021-07-30 01:09:36 | × | waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 276 seconds) |
| 2021-07-30 01:09:56 | <Axman6> | did you import Data.Aeson (ToJSON(..))? |
| 2021-07-30 01:11:10 | → | shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 2021-07-30 01:11:40 | × | xff0x quits (~xff0x@2001:1a81:52ef:f900:6be3:99e6:cbd0:482d) (Ping timeout: 272 seconds) |
| 2021-07-30 01:12:48 | → | xff0x joins (~xff0x@2001:1a81:532e:4200:3fe0:364:9ae2:d4b0) |
| 2021-07-30 01:14:26 | × | bontaq quits (~user@ool-18e47f8d.dyn.optonline.net) (Ping timeout: 256 seconds) |
| 2021-07-30 01:16:52 | → | roboguy__ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 01:17:42 | × | Null_A quits (~null_a@2601:645:8700:2290:44f7:81a6:341:7abe) (Remote host closed the connection) |
| 2021-07-30 01:18:48 | → | Null_A joins (~null_a@2601:645:8700:2290:44f7:81a6:341:7abe) |
| 2021-07-30 01:20:06 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:1557:b33d:ca8c:dfa4) (Ping timeout: 256 seconds) |
| 2021-07-30 01:22:20 | × | vysn quits (~vysn@user/vysn) (Remote host closed the connection) |
| 2021-07-30 01:28:39 | × | roboguy__ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) () |
| 2021-07-30 01:29:03 | → | neurocyte3 joins (~neurocyte@45.93.108.22) |
| 2021-07-30 01:29:03 | × | neurocyte3 quits (~neurocyte@45.93.108.22) (Changing host) |
| 2021-07-30 01:29:03 | → | neurocyte3 joins (~neurocyte@user/neurocyte) |
| 2021-07-30 01:32:06 | <lechner> | Axman6: thanks! I forgot the brackets |
| 2021-07-30 01:32:38 | × | neurocyte quits (~neurocyte@user/neurocyte) (Ping timeout: 252 seconds) |
| 2021-07-30 01:32:38 | neurocyte3 | is now known as neurocyte |
| 2021-07-30 01:32:43 | <lechner> | also, is it possible to generate pretty, canonical JSON? |
| 2021-07-30 01:35:23 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-30 01:36:51 | × | bruceleewees quits (~bruceleew@83.24.236.64.ipv4.supernova.orange.pl) (Ping timeout: 268 seconds) |
| 2021-07-30 01:37:44 | → | bruceleewees joins (~bruceleew@83.24.236.64.ipv4.supernova.orange.pl) |
| 2021-07-30 01:39:08 | <c_wraith> | um. what does "canonical" mean in this context? |
| 2021-07-30 01:39:23 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 258 seconds) |
| 2021-07-30 01:39:23 | <lechner> | sorted by field name |
| 2021-07-30 01:39:34 | <c_wraith> | I've never seen a spec say that's canonical |
| 2021-07-30 01:40:09 | <lechner> | c_wraith: https://metacpan.org/pod/JSON#canonical |
| 2021-07-30 01:40:41 | <c_wraith> | CPAN isn't a JSON spec |
| 2021-07-30 01:41:05 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 01:41:26 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 2021-07-30 01:41:31 | <lechner> | is there another way? we commit some JSON to Git. maybe there is an external program |
| 2021-07-30 01:42:14 | <euouae> | it's the same data, why does it matter? |
| 2021-07-30 01:42:22 | <euouae> | If you want it sorted, then you can sort it |
| 2021-07-30 01:42:35 | <lechner> | how? |
| 2021-07-30 01:43:12 | <euouae> | https://hackage.haskell.org/package/aeson-1.5.6.0/docs/Data-Aeson.html#g:3 |
| 2021-07-30 01:43:24 | <euouae> | Apply a tree transformation |
| 2021-07-30 01:44:08 | <lechner> | actually, there is https://hackage.haskell.org/package/canonical-json |
| 2021-07-30 01:45:28 | <lechner> | although Decoding/encoding Unicode code-points beyond U+00ff is currently broken |
| 2021-07-30 01:46:07 | → | phma joins (phma@2001:5b0:210d:748:6bd3:69b4:5bd0:5d7a) |
| 2021-07-30 01:46:13 | <euouae> | https://hackage.haskell.org/package/canonical-json-0.6.0.0/docs/src/Text.JSON.Canonical.Parse.html#renderCanonicalJSON |
| 2021-07-30 01:46:22 | <euouae> | You can see they're just using a tree transformation that sorts it |
| 2021-07-30 01:47:37 | <euouae> | Looks like the canonical-json package should be avoided |
| 2021-07-30 01:47:52 | <lechner> | yeah |
| 2021-07-30 01:48:13 | <euouae> | just sort the tree yourself and rely on aeson for printing |
| 2021-07-30 01:49:03 | → | falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) |
| 2021-07-30 01:49:11 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-30 01:52:32 | <euouae> | What does forall s. mean? In a signature |
| 2021-07-30 01:52:56 | <euouae> | For example, https://hackage.haskell.org/package/base-4.15.0.0/docs/Control-Monad-ST-Safe.html#v:runST |
| 2021-07-30 01:53:32 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 2021-07-30 01:53:47 | <EvanR> | in that case it's how you use rankN types, in this case rank 2. The argument type is itself a polymorphic function type |
| 2021-07-30 01:54:04 | <c_wraith> | It's a polymorphic value, not a function. :P |
| 2021-07-30 01:54:14 | <EvanR> | shoot i was going by memory xD |
| 2021-07-30 01:54:14 | <lechner> | euouae: how about pretty? |
| 2021-07-30 01:54:46 | <euouae> | I'm not following |
| 2021-07-30 01:54:52 | <EvanR> | yeah I'm lost now. |
| 2021-07-30 01:55:00 | <euouae> | lechner: What about pretty? |
| 2021-07-30 01:55:02 | <c_wraith> | euouae: it literally means "for all s". It's the consequences of that which get interesting. |
| 2021-07-30 01:55:16 | <lechner> | euouae: sorry, pretty JSON |
| 2021-07-30 01:55:21 | <euouae> | c_wraith: but 'a' means for any. So... ? |
| 2021-07-30 01:55:33 | <euouae> | lechner: I don't know what that means, explain please? |
| 2021-07-30 01:55:36 | <c_wraith> | euouae: the interesting thing there is that it's inside the parenthesis |
| 2021-07-30 01:56:06 | <euouae> | c_wraith: so it's (for all s. ST s) a ? |
| 2021-07-30 01:56:07 | <EvanR> | the letter itself doesn't matter, it's just a name |
| 2021-07-30 01:56:09 | <c_wraith> | euouae: more explicitly, the type of runST is forall a. (forall s. ST s a) -> a |
| 2021-07-30 01:56:55 | <c_wraith> | euouae: since it's in the parenthesis, the scope of the polymorphism is constrained. The argument to the function must be polymorphic over all s, no matter what choice is made for a |
| 2021-07-30 01:56:55 | <lechner> | euouae: formatted for human consumption, for example https://metacpan.org/pod/JSON#pretty |
| 2021-07-30 01:57:31 | <euouae> | c_wraith: Ok, thus it is 'private'. Kinda like being unable to have a general arrow a->b |
| 2021-07-30 01:58:17 | <c_wraith> | euouae: in a sense. It means the choice of s is unknown to the caller, so they must provide a value that will work with any s |
| 2021-07-30 02:00:21 | <c_wraith> | > let foo :: (forall n. Num n => n -> n) -> (Int, Double) ; foo f = (f 1, f 3.2) in foo (+1) -- a slightly more obvious use case |
| 2021-07-30 02:00:23 | <lambdabot> | (2,4.2) |
| 2021-07-30 02:00:29 | → | alx741 joins (~alx741@181.196.69.85) |
| 2021-07-30 02:01:15 | <c_wraith> | euouae: That's a simple example of requiring the function being passed in to work with any instance of Num, so that it can be used at two different types in the body |
| 2021-07-30 02:01:40 | → | sh9 joins (~sh9@softbank060116136158.bbtec.net) |
| 2021-07-30 02:01:46 | <euouae> | nice |
| 2021-07-30 02:01:50 | <euouae> | wait, is that valid Haskell? |
| 2021-07-30 02:02:01 | <c_wraith> | it is if you add the RankNTypes extension |
All times are in UTC.