Newest at the top
2024-12-27 23:40:09 +0100 | <Zenen> | I thought it would still be best to import everything specifically so that it was clear where all the functions were coming from (better for code readability) and decided this was a reasonable solution |
2024-12-27 23:39:14 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-27 23:38:18 +0100 | <Zenen> | all of Cln.Types would be imported, with multiple `amount` functions and this casting is what specified it. I imagine there was a change in stack over the past 2 years, but I don't have the vocabulary to figure out what it was |
2024-12-27 23:37:10 +0100 | <Zenen> | This is a good question, one I couldn't get a good answer for the last time. The code was originally disambiguated with sections like this: `(amount :: Channel -> Amount)` |
2024-12-27 23:35:44 +0100 | <monochrom> | But now it does. What added the name clash? |
2024-12-27 23:35:36 +0100 | <monochrom> | Therefore presumably there was no name clash once upon a time. |
2024-12-27 23:35:25 +0100 | <monochrom> | Presumably this code base compiled fine once upon a time. |
2024-12-27 23:34:47 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-27 23:34:38 +0100 | <Zenen> | creating distinct field names might be a bit of a long way around |
2024-12-27 23:33:41 +0100 | <Zenen> | Yep, I inherited this codebase and I'm about 2 errors from getting it to compile |
2024-12-27 23:33:11 +0100 | <monochrom> | The most elegant and simplest is to have distinct field names in the first place. |
2024-12-27 23:32:28 +0100 | <monochrom> | Qualified import does not make a difference until Channel2 comes from a different module. |
2024-12-27 23:32:16 +0100 | <Zenen> | right, and "amount" is a function which returns a specific value from the given record type |
2024-12-27 23:31:57 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 265 seconds) |
2024-12-27 23:31:41 +0100 | <monochrom> | Then that's just because the other "amount" is not imported. |
2024-12-27 23:31:24 +0100 | <Zenen> | But I can import Channel(amount) and then it works... is there perhaps an elegant way to do this with qualified imports giving different names to the fields? |
2024-12-27 23:29:48 +0100 | sayurc | (~sayurc@169.150.203.34) (Ping timeout: 244 seconds) |
2024-12-27 23:29:34 +0100 | <monochrom> | Haskell doesn't have records, despite offering to fake the syntax. |
2024-12-27 23:29:09 +0100 | <monochrom> | Right, there is no such thing as Channel.amount. |
2024-12-27 23:28:45 +0100 | <Zenen> | but if I `import Cln.Types(Channel(amount), Channel2(amount))` then I don't know how to disambiguate the two fields. Channel.amount throws an error saying that there's no module named 'Channel' which has been imported |
2024-12-27 23:28:36 +0100 | d0xfs | (~d0xfs@bras-base-dprvon4101w-grc-06-69-159-184-113.dsl.bell.ca) () |
2024-12-27 23:27:11 +0100 | <Zenen> | I need to import the record so that I can gain unambiguous access to one of its fields. Channel and Channel2 both have 'amount' fields, and I can effectively `import Cln.Types(Channel(amount))` |
2024-12-27 23:26:41 +0100 | <monochrom> | import Cln.Types(Channel) |
2024-12-27 23:25:33 +0100 | <Zenen> | howdy folks! I've got a small confusion going on regarding a Haskell project I'm working on. I have a module named Cln.Types which defines a number of records. When I try to import one of those types `import Cln.Types.Channel`, the compiler tells me that it cannot find the module. |
2024-12-27 23:25:07 +0100 | j1n37 | (~j1n37@user/j1n37) j1n37 |
2024-12-27 23:24:42 +0100 | j1n37 | (~j1n37@user/j1n37) (Read error: Connection reset by peer) |
2024-12-27 23:24:08 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
2024-12-27 23:23:40 +0100 | d0xfs | (~d0xfs@bras-base-dprvon4101w-grc-06-69-159-184-113.dsl.bell.ca) |
2024-12-27 23:19:18 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-27 23:13:58 +0100 | Zenen | (~Zenen@node-1w7jr9uk45pdylasbk2itgwn9.ipv6.telus.net) |
2024-12-27 23:13:17 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-12-27 23:12:10 +0100 | j1n37 | (~j1n37@user/j1n37) j1n37 |
2024-12-27 23:09:12 +0100 | Square | (~Square@user/square) (Ping timeout: 276 seconds) |
2024-12-27 23:08:29 +0100 | j1n37 | (~j1n37@user/j1n37) (Read error: Connection reset by peer) |
2024-12-27 23:06:24 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-12-27 23:03:27 +0100 | <fp> | Ah ok |
2024-12-27 23:02:38 +0100 | <geekosaur> | to include the constructors |
2024-12-27 23:02:32 +0100 | <geekosaur> | if you're using an explicit import list, import MyUnion(..) |
2024-12-27 23:02:10 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-27 23:00:23 +0100 | <fp> | How does one make a tagged union and then use it in another module? For instance, I have =data MyUnion = Thing1 Text | Thing2 Text=. In the module I defined it, I can create an instace of this with =Thing1 "hello"=. However, if I do the same in my test suite, then it complains that =Thing1= isn't defined. |
2024-12-27 22:49:25 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-27 22:46:47 +0100 | simplystuart | (~simplystu@static-71-173-136-93.hrbgpa.fios.verizon.net) (Ping timeout: 252 seconds) |
2024-12-27 22:44:34 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-12-27 22:44:33 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-27 22:32:00 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds) |
2024-12-27 22:27:49 +0100 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
2024-12-27 22:27:16 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-27 22:24:00 +0100 | euleritian | (~euleritia@dynamic-176-006-141-001.176.6.pool.telefonica.de) |
2024-12-27 22:16:25 +0100 | euleritian | (~euleritia@dynamic-176-006-128-055.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-12-27 22:15:30 +0100 | l_k | (~student@85.172.76.246) |