Logs: freenode/#haskell
| 2020-10-21 05:11:08 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 2020-10-21 05:13:45 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-10-21 05:18:45 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2020-10-21 05:20:23 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) () |
| 2020-10-21 05:20:56 | → | geowiesnot joins (~user@87-89-181-157.abo.bbox.fr) |
| 2020-10-21 05:23:03 | × | coot quits (~coot@37.30.49.255.nat.umts.dynamic.t-mobile.pl) (Remote host closed the connection) |
| 2020-10-21 05:24:27 | → | coot joins (~coot@37.30.49.255.nat.umts.dynamic.t-mobile.pl) |
| 2020-10-21 05:35:47 | × | acidjnk_new2 quits (~acidjnk@p200300d0c7237831d40d0866fc0488e0.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-10-21 05:37:53 | → | Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2020-10-21 05:39:10 | → | shafox joins (~shafox@106.51.234.111) |
| 2020-10-21 05:41:35 | → | ggole joins (~ggole@2001:8003:8119:7200:b1ad:260c:cc33:2a8d) |
| 2020-10-21 05:41:51 | → | bartemius joins (~bartemius@109.252.19.142) |
| 2020-10-21 05:42:25 | × | reppertj quits (~textual@pool-96-246-209-59.nycmny.fios.verizon.net) (Quit: Textual IRC Client: www.textualapp.com) |
| 2020-10-21 05:45:28 | → | polyrain joins (~polyrain@2001:8003:e501:6901:d502:fff6:715b:77f5) |
| 2020-10-21 05:50:49 | → | avoandmayo joins (~textual@122-58-158-238-adsl.sparkbb.co.nz) |
| 2020-10-21 05:51:53 | <sim590> | I have this code: https://paste.debian.net/1168059/ and I'm getting this error: https://paste.debian.net/1168060/. Why ? |
| 2020-10-21 05:52:09 | <sim590> | I don't understand what I'm missing nor what the message tries to tell me. |
| 2020-10-21 05:52:12 | → | polyrain_ joins (~polyrain@2001:8003:e501:6901:900f:a04:c6e9:3caa) |
| 2020-10-21 05:52:35 | × | avoandmayo quits (~textual@122-58-158-238-adsl.sparkbb.co.nz) (Client Quit) |
| 2020-10-21 05:53:03 | <sim590> | The message is related to DHComputable, but I don't understand why I don't get any error for the usage of dhEchange and I get a message about exponentiate.. |
| 2020-10-21 05:53:37 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-10-21 05:54:26 | × | polyrain quits (~polyrain@2001:8003:e501:6901:d502:fff6:715b:77f5) (Ping timeout: 240 seconds) |
| 2020-10-21 05:54:33 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 2020-10-21 05:54:37 | × | geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 246 seconds) |
| 2020-10-21 05:55:20 | <shafox> | I am on ghcup, with ghc-8.10.2, cabal 3.2, and this is my xmonad project that I am creating. https://github.com/shadow-fox/foxmonad however when i do cabal build, i get this error: https://gist.github.com/shadow-fox/3cb1d3639395548dc091b0b2c73df8ac |
| 2020-10-21 05:55:23 | → | chele joins (~chele@ip5b416ea2.dynamic.kabel-deutschland.de) |
| 2020-10-21 05:56:14 | → | jsynacek joins (~jsynacek@ip-185-149-130-112.kmenet.cz) |
| 2020-10-21 05:57:28 | → | asheshambasta joins (~user@ptr-e1lysawl9rr13i61o92.18120a2.ip6.access.telenet.be) |
| 2020-10-21 05:57:51 | <sim590> | (The issue is about the line 24 in the pastebin) |
| 2020-10-21 05:59:04 | → | isovector1 joins (~isovector@172.103.216.166.cable.tpia.cipherkey.com) |
| 2020-10-21 05:59:06 | <shafox> | Don't know what is wrong. |
| 2020-10-21 05:59:23 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 265 seconds) |
| 2020-10-21 05:59:57 | → | britva joins (~britva@31-10-157-156.cgn.dynamic.upc.ch) |
| 2020-10-21 05:59:58 | × | Foritus quits (~buggery@cpc91334-watf11-2-0-cust153.15-2.cable.virginm.net) (Read error: Connection reset by peer) |
| 2020-10-21 06:00:02 | × | scar451 quits (~scar45@185.163.110.116) () |
| 2020-10-21 06:00:32 | → | Foritus joins (~buggery@cpc91334-watf11-2-0-cust153.15-2.cable.virginm.net) |
| 2020-10-21 06:00:42 | <c_wraith> | sim590: well, that error is referring to a line number not in the paste.... |
| 2020-10-21 06:01:54 | <sim590> | c_wraith: yes. I didn't want to include confusing content. |
| 2020-10-21 06:02:13 | <c_wraith> | sim590: anyway... the problem is that it can't tell what instance of DHComputable you want |
| 2020-10-21 06:02:46 | <c_wraith> | sim590: an indicator comment on line 24 saying that it was the line the error was talking about would have been kind |
| 2020-10-21 06:02:51 | → | phaul joins (~phaul@ruby/staff/phaul) |
| 2020-10-21 06:03:10 | <sim590> | Yes. True. Sorry about that. |
| 2020-10-21 06:03:15 | → | Sanchayan joins (~Sanchayan@171.61.92.239) |
| 2020-10-21 06:03:22 | <sim590> | So, I'm not using classes correctly here. |
| 2020-10-21 06:03:37 | <sim590> | Is that it? |
| 2020-10-21 06:03:51 | <c_wraith> | sim590: the DHComputable instance is chosen based on both v and b. It can infer v from the input to exponentiate, but it has no idea what to pick for b |
| 2020-10-21 06:04:08 | <sim590> | Oh |
| 2020-10-21 06:04:19 | × | nurupo quits (~nurupo.ga@unaffiliated/nurupo) (Ping timeout: 244 seconds) |
| 2020-10-21 06:04:33 | <c_wraith> | sim590: if you used parent_pk, it might be able to infer the type |
| 2020-10-21 06:04:57 | <c_wraith> | sim590: otherwise you could use the ScopedTypeVariables to talk about types from the signature. |
| 2020-10-21 06:05:18 | <shafox> | the xmonad-extras I believe what is failing to build. |
| 2020-10-21 06:05:31 | <sim590> | "talk about types from the signature". I assumed it was the case by default? I'm very surprised. |
| 2020-10-21 06:05:50 | <c_wraith> | by default, type variables in expressions are considered to be fresh types. |
| 2020-10-21 06:06:14 | <c_wraith> | So it will rename them internally by sticking numbers on to them |
| 2020-10-21 06:08:47 | <sim590> | OK, but in practice, it seems to me that it's infeasible for dhExchange to take variables v and b while exponentiate would take v0 as a type. Is it? |
| 2020-10-21 06:09:21 | <c_wraith> | sim590: one other thought - I'm not sure v and b should be independent in the class. Does it make sense that the two types can be chosen independently? |
| 2020-10-21 06:09:49 | <c_wraith> | Or will the choice of one always require a particular choice for the other? |
| 2020-10-21 06:10:34 | <sim590> | Yes, I think that it makes sense since v stands for "private key" and b stands for "public key" and it could be implemented with this function for example: https://hackage.haskell.org/package/cryptonite-0.27/docs/Crypto-PubKey-DH.html#v:getShared |
| 2020-10-21 06:10:36 | → | nurupo joins (~nurupo.ga@unaffiliated/nurupo) |
| 2020-10-21 06:11:08 | → | fxg joins (~fxg@unaffiliated/fxg) |
| 2020-10-21 06:11:13 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-10-21 06:11:22 | <c_wraith> | That sounds like it doesn't make sense to select them independently. It makes no sense to choose a ECDH public key and an RSA private key |
| 2020-10-21 06:11:23 | <sim590> | c_wraith: Well. Yes, the choice of one implies the other type. |
| 2020-10-21 06:11:41 | <c_wraith> | ok, good |
| 2020-10-21 06:11:44 | <sim590> | Yeah. So, I should change the signature? |
| 2020-10-21 06:11:51 | <c_wraith> | Then you can modify the class definition a little bit |
| 2020-10-21 06:12:24 | <c_wraith> | If you enable the FunctionalDependencies extension, you can tell ghc that choices of one type determine the other type. |
| 2020-10-21 06:12:39 | <sim590> | Interesting. |
| 2020-10-21 06:12:42 | → | SanchayanM joins (~Sanchayan@122.181.211.206) |
| 2020-10-21 06:12:45 | × | SanchayanM quits (~Sanchayan@122.181.211.206) (Remote host closed the connection) |
| 2020-10-21 06:12:48 | <c_wraith> | I think in this particular case, they only come in pairs, right? Either type specifies the other one? |
| 2020-10-21 06:13:29 | <c_wraith> | In that case, you would change it to class DHComputable v b | v -> b, b -> v where ... |
| 2020-10-21 06:13:45 | → | shatriff joins (~vitaliish@176.52.219.10) |
| 2020-10-21 06:13:47 | <c_wraith> | that extra part from | to the where are the functional dependency |
| 2020-10-21 06:14:06 | <c_wraith> | It says that for any particular choice of type v, there can only be one b, and vice versa |
| 2020-10-21 06:14:10 | × | Sanchayan quits (~Sanchayan@171.61.92.239) (Ping timeout: 260 seconds) |
| 2020-10-21 06:14:29 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:6cd0:22a:1738:5d24) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-10-21 06:14:51 | <c_wraith> | The combination of those things tells ghc not to allow instances that would violate that rule, and that it can use that rule to infer types |
| 2020-10-21 06:15:01 | <sim590> | c_wraith: Yeah, so if you specify the private key type, then a public key type would correspond and vice versa I guess. |
| 2020-10-21 06:15:04 | → | alp joins (~alp@2a01:e0a:58b:4920:214e:c6f7:dc70:92ac) |
| 2020-10-21 06:15:44 | <sim590> | That's very nice. |
| 2020-10-21 06:16:34 | <c_wraith> | That should solve the issue you're running into, and be safer (it can catch cases where you mix things up while writing instances) |
| 2020-10-21 06:17:47 | × | raoulb quits (~weechat@stateless.vsos.ethz.ch) (Ping timeout: 260 seconds) |
| 2020-10-21 06:17:48 | <sim590> | I'm continuously learning. I have never really created classes for concrete use cases. I must admit that I don't master the technique for defining classes properly. Would you say that FunctionalDependencies is quite common pattern ? |
| 2020-10-21 06:17:53 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2020-10-21 06:18:09 | <c_wraith> | It is relatively common with multiparameter classes |
| 2020-10-21 06:18:22 | <sim590> | c_wraith: I guess that this is a good benefit for the library I'm writing. |
| 2020-10-21 06:18:23 | → | christo joins (~chris@81.96.113.213) |
| 2020-10-21 06:18:54 | <sim590> | Right. This is the first time I use multiparameter classes so that's why I discover this now. |
| 2020-10-21 06:19:26 | <c_wraith> | like, you're using MonadState there. class Monad m => MonadState s m | m -> s where ... |
| 2020-10-21 06:19:34 | × | fxg quits (~fxg@unaffiliated/fxg) (Quit: Leaving) |
| 2020-10-21 06:19:59 | <c_wraith> | That only goes one direction. The monad type must always specify the state type, but you can have multiple different monad types specify the same state type |
| 2020-10-21 06:20:05 | <sim590> | Ohhh. So that's what that part (m -> s) meant in the documentation. |
| 2020-10-21 06:20:11 | → | raoulb joins (~weechat@stateless.vsos.ethz.ch) |
| 2020-10-21 06:20:14 | <c_wraith> | yep! |
| 2020-10-21 06:20:21 | <sim590> | Nice |
| 2020-10-21 06:20:30 | → | Andy2011Zoe joins (~Andy2011Z@217.146.82.202) |
| 2020-10-21 06:20:51 | <sim590> | Thanks for all those explanations! |
| 2020-10-21 06:20:55 | <c_wraith> | you're welcome |
| 2020-10-21 06:22:01 | × | bitmagie quits (~Thunderbi@200116b806c15c00bd70654fe0e81318.dip.versatel-1u1.de) (Quit: bitmagie) |
All times are in UTC.