Logs: liberachat/#haskell
| 2021-08-10 13:12:48 | → | fgaz joins (~fgaz@2001:470:69fc:105::842) |
| 2021-08-10 13:13:07 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-08-10 13:13:36 | → | ServerStatsDisco joins (~serversta@2001:470:69fc:105::1a) |
| 2021-08-10 13:17:34 | → | doyougnu joins (~user@c-73-25-202-122.hsd1.or.comcast.net) |
| 2021-08-10 13:17:55 | × | Morrow_ quits (~Morrow@bzq-110-168-31-106.red.bezeqint.net) (Quit: Leaving) |
| 2021-08-10 13:18:06 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 2021-08-10 13:19:29 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 248 seconds) |
| 2021-08-10 13:19:48 | → | adziahel[m] joins (~adziahelm@2001:470:69fc:105::b4d) |
| 2021-08-10 13:19:49 | → | bb010g joins (~bb010g@2001:470:69fc:105::9a5) |
| 2021-08-10 13:20:10 | × | chomwitt quits (~chomwitt@2a02:587:dc02:6400:12c3:7bff:fe6d:d374) (Ping timeout: 268 seconds) |
| 2021-08-10 13:20:28 | → | infinisil joins (~infinisil@2001:470:69fc:105::ff8) |
| 2021-08-10 13:21:27 | → | kadoban joins (~kadoban@user/kadoban) |
| 2021-08-10 13:22:32 | → | epolanski joins (uid312403@id-312403.brockwell.irccloud.com) |
| 2021-08-10 13:24:17 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 248 seconds) |
| 2021-08-10 13:24:41 | → | lwe[m] joins (~dendrumat@2001:470:69fc:105::2f9b) |
| 2021-08-10 13:26:02 | → | aveltras[m] joins (~aveltrasm@2001:470:69fc:105::3ef9) |
| 2021-08-10 13:26:14 | → | MatrixTravelerbo joins (~voyagert2@2001:470:69fc:105::22) |
| 2021-08-10 13:27:01 | → | vbeatrice[m] joins (~vbeatrice@2001:470:69fc:105::3ebf) |
| 2021-08-10 13:27:09 | × | burnside_ quits (~burnsides@dhcp168-020.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-08-10 13:27:22 | × | tungki quits (~tngk@subs31-116-206-15-25.three.co.id) (Read error: Connection reset by peer) |
| 2021-08-10 13:27:41 | → | burnsidesLlama joins (~burnsides@dhcp168-020.wadham.ox.ac.uk) |
| 2021-08-10 13:28:40 | → | sm joins (~sm@plaintextaccounting/sm) |
| 2021-08-10 13:29:20 | → | jophish joins (~jophish@2001:470:69fc:105::670) |
| 2021-08-10 13:30:51 | → | _73 joins (~user@pool-96-252-123-136.bstnma.fios.verizon.net) |
| 2021-08-10 13:31:03 | → | Ollie[m] joins (~ollieocha@2001:470:69fc:105::41a5) |
| 2021-08-10 13:32:17 | × | burnsidesLlama quits (~burnsides@dhcp168-020.wadham.ox.ac.uk) (Ping timeout: 268 seconds) |
| 2021-08-10 13:32:51 | → | zfnmxt joins (~zfnmxtzfn@2001:470:69fc:105::2b32) |
| 2021-08-10 13:32:52 | → | marinelli[m] joins (~marinelli@2001:470:69fc:105::2d8) |
| 2021-08-10 13:33:24 | → | bitonic joins (~bitonic@2001:470:69fc:105::1812) |
| 2021-08-10 13:33:29 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-08-10 13:33:46 | → | schuelermine[m] joins (~schuelerm@user/schuelermine) |
| 2021-08-10 13:34:40 | → | ac joins (~aloiscoch@2001:470:69fc:105::65) |
| 2021-08-10 13:35:06 | → | ericson2314 joins (~ericson23@2001:470:69fc:105::70c) |
| 2021-08-10 13:35:17 | → | jaror[m] joins (~jaror@2001:470:69fc:105::265) |
| 2021-08-10 13:35:19 | → | Deide joins (~deide@user/deide) |
| 2021-08-10 13:35:23 | <_73> | I have a lot of functions that simply associate strings to `Either Error Int`. For example I have `foo "hello" = Right 7; foo "hey" Right 2; foo _ = Left someError`. `foo` though may have up to 60 different strings to pattern match against. If this were you would you just have a bunch of pattern match statements or would you use `Data.Map.fromList` and on a list of pairs like `[("hello", 7) ... ]`. Or would you do something else? |
| 2021-08-10 13:35:28 | → | jkachmar joins (~jkachmar@2001:470:69fc:105::c72d) |
| 2021-08-10 13:35:37 | → | reza[m] joins (~rezaphone@2001:470:69fc:105::3eda) |
| 2021-08-10 13:36:46 | → | ormaaj joins (~ormaaj@user/ormaaj) |
| 2021-08-10 13:36:50 | → | siraben joins (~siraben@user/siraben) |
| 2021-08-10 13:36:51 | <merijn> | _73: I would use Data.Map |
| 2021-08-10 13:36:52 | → | hsiktas[m] joins (~hsiktasma@2001:470:69fc:105::30d4) |
| 2021-08-10 13:37:31 | <_73> | ok that is what I have been doing. |
| 2021-08-10 13:37:45 | × | enoq quits (~enoq@194-208-179-35.lampert.tv) (Quit: enoq) |
| 2021-08-10 13:37:55 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds) |
| 2021-08-10 13:39:29 | × | hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1) |
| 2021-08-10 13:40:01 | → | hendursaga joins (~weechat@user/hendursaga) |
| 2021-08-10 13:40:38 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
| 2021-08-10 13:40:56 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 2021-08-10 13:43:54 | <acowley_> | Does lsp-haskell have a capability to insert a missing type signature? I can't find it. |
| 2021-08-10 13:44:13 | acowley_ | is now known as acowle |
| 2021-08-10 13:44:16 | acowle | is now known as acowley |
| 2021-08-10 13:44:52 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 2021-08-10 13:46:51 | <Drew[m]1> | Hrm. I've been doing evil Haskell and run into a roadblock that just sort of seems... wrong... |
| 2021-08-10 13:47:52 | <Drew[m]1> | The idea was: take the basic ideas seen here https://www.reddit.com/r/haskell/comments/p0pclw/haskell_methods/h8c5huc/ and rewrite them with type families to avoid using fundeps and see what happens |
| 2021-08-10 13:48:32 | <Drew[m]1> | I wrote this: https://paste.tomsmeding.com/nLEWqt3D |
| 2021-08-10 13:48:59 | <Drew[m]1> | But the compiler rejects the last instance |
| 2021-08-10 13:49:42 | × | trcc quits (~trcc@2-104-60-169-cable.dk.customer.tdc.net) (Remote host closed the connection) |
| 2021-08-10 13:49:51 | <merijn> | With what error? |
| 2021-08-10 13:50:14 | → | trcc joins (~trcc@2-104-60-169-cable.dk.customer.tdc.net) |
| 2021-08-10 13:50:33 | <Drew[m]1> | Here's the code and error together: https://paste.tomsmeding.com/WEpixOc7 |
| 2021-08-10 13:51:38 | <Drew[m]1> | So the roadblock is the associated type family can't refer to a type variable from instance context |
| 2021-08-10 13:51:40 | <merijn> | Drew[m]1: Where's the 'a' supposed to come from? |
| 2021-08-10 13:52:02 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 2021-08-10 13:53:46 | <Drew[m]1> | So my thinking is that if the `Magic obj` meets the constraint then the type of `a` is implied thanks to the functional dependency in `HasField` |
| 2021-08-10 13:54:16 | <Drew[m]1> | I want to use that information to define the associated type family, but apparently I can't. |
| 2021-08-10 13:55:09 | × | trcc quits (~trcc@2-104-60-169-cable.dk.customer.tdc.net) (Ping timeout: 276 seconds) |
| 2021-08-10 13:55:12 | <merijn> | Drew[m]1: Instance constraints are only considered for type-checking, not for resolution |
| 2021-08-10 13:55:21 | → | xsperry joins (~as@user/xsperry) |
| 2021-08-10 13:55:42 | <merijn> | So pretty sure you can't "see" the fundeps until its too late |
| 2021-08-10 13:57:08 | <Athas> | I am using gitrev to embed Git commit information in my Haskell program. Unfortunately since the module with that TH stuff rarely changes, the commit information is often stale, unless I do a clean rebuild. How do I best resolve this? |
| 2021-08-10 13:57:42 | <Athas> | I can think of two ways: one is to somehow make cabal recompile that (small) module every time. Another is to put the TH stuff in the module that contains the 'main' function, and hope that will always be recompiled. Any others? |
| 2021-08-10 13:57:47 | <Athas> | I'd rather avoid a custom Setup.hs. |
| 2021-08-10 13:58:16 | <merijn> | Athas: Think outside the box: Invoke cabal via Makefile which generates a GitRev.hs :p |
| 2021-08-10 13:58:58 | <Athas> | brilant |
| 2021-08-10 13:59:47 | <merijn> | Athas: Can even hide GitRev.hs beyond a cabal flag so that it only applies/imports when invoked via make so that a regular cabal build only includes the Paths_pkg version stuff instead |
| 2021-08-10 14:00:03 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-08-10 14:00:21 | × | jespada quits (~jespada@90.254.247.46) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-08-10 14:00:35 | <merijn> | Athas: And since cabal's recompilation stuff checks content hashes you probably won't even get recompiles if the regenerated GitRev.hs has the exact same contents |
| 2021-08-10 14:00:52 | <maerwald[m]> | Athas: you can read a file at compile time via TH and invalidate the cache when it changes. That works with TH |
| 2021-08-10 14:01:00 | <maerwald[m]> | that can just be a text file |
| 2021-08-10 14:01:02 | → | jespada joins (~jespada@90.254.247.46) |
| 2021-08-10 14:01:17 | <Athas> | maerwald: how do I invalidate the cache? |
| 2021-08-10 14:01:47 | <Athas> | I'm looking at the gitrev code and it does look like it's adding some dependencies to Git files via TH... but it clearly doesn't work well for me. |
| 2021-08-10 14:02:08 | <maerwald[m]> | it does work, I used it a lot |
| 2021-08-10 14:02:12 | <merijn> | Athas: It's probably because cabal isn't rebuilding the component unless files have changed |
| 2021-08-10 14:02:27 | <maerwald[m]> | you also have to add the file to extra-source-files I think |
| 2021-08-10 14:02:27 | <merijn> | And cabal's recompilation logic isn't aware of GHC's TH dependencies, afaik |
| 2021-08-10 14:02:51 | <maerwald[m]> | that's why you add it do extra-source-files |
| 2021-08-10 14:04:11 | → | Pickchea joins (~private@user/pickchea) |
| 2021-08-10 14:04:17 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 2021-08-10 14:04:17 | <Athas> | merijn: ah, it's a separate thing? That might explain why. |
| 2021-08-10 14:04:26 | <Athas> | maerwald[m]: what is "it" here? |
| 2021-08-10 14:04:49 | <Athas> | I have this module, which contains the Git stuff, and is rarely recompiled: https://github.com/diku-dk/futhark/blob/master/src/Futhark/Version.hs |
| 2021-08-10 14:04:49 | → | __monty__ joins (~toonn@user/toonn) |
| 2021-08-10 14:05:07 | <maerwald[m]> | Athas: the file you read via TH |
| 2021-08-10 14:05:40 | → | burnsidesLlama joins (~burnsides@dhcp168-020.wadham.ox.ac.uk) |
| 2021-08-10 14:07:41 | <Athas> | I don't know which file I read via TH. That's hidden inside the guts of gitrev, and seems to be various files in .git.\ |
| 2021-08-10 14:07:59 | <Athas> | Adding those to extra-source-files would also make compilation fail when .git is not present, right? |
| 2021-08-10 14:08:06 | <merijn> | Yes |
All times are in UTC.