Newest at the top
2024-12-28 00:01:45 +0100 | euleritian | (~euleritia@dynamic-176-006-141-001.176.6.pool.telefonica.de) (Ping timeout: 260 seconds) |
2024-12-28 00:00:42 +0100 | <monochrom> | "one more turn" |
2024-12-28 00:00:32 +0100 | <mauke> | progress! |
2024-12-27 23:59:27 +0100 | <Zenen> | It seems that solving all of the compilation errors has unveiled new ones |
2024-12-27 23:59:00 +0100 | <Zenen> | I'm really looking forward to getting back into functional programming. I haven't fully grokked it yet, unfortunately |
2024-12-27 23:58:32 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-27 23:56:56 +0100 | <mauke> | Just 42 :: Maybe Int -- fine |
2024-12-27 23:56:24 +0100 | <mauke> | print (42 :: Just Int) -- invalid, trying to use a data constructor as a type |
2024-12-27 23:55:46 +0100 | <mauke> | print (Maybe 42) -- invalid, trying to use a type constructor as a term |
2024-12-27 23:53:46 +0100 | <geekosaur> | Maybe is a type constructor, Nothing and Just are value / data / term level constructors |
2024-12-27 23:53:26 +0100 | <geekosaur> | data Maybe a = Nothing | Just a |
2024-12-27 23:52:49 +0100 | <Zenen> | Okay, I have solved this problem but I don't quite understand how. What is a type constructor vs a value constructor? |
2024-12-27 23:51:34 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-27 23:51:19 +0100 | <geekosaur> | the weird error is because dependent types are something of a work in progress, where the type constructor *would* be legal to use there (but produce even weirder errors, most probably) |
2024-12-27 23:50:55 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2024-12-27 23:50:08 +0100 | <Zenen> | wizard!! |
2024-12-27 23:49:33 +0100 | <geekosaur> | I'd guess it's the same as earlier, the type constructor and value constructor have the same name but you imported only the type constructor (need Destination(..) instead of just Destination in the import list) |
2024-12-27 23:48:25 +0100 | <Zenen> | Only one compilation error to go! `Illegal term-level use of the type constructor or class ‘Destination'` |
2024-12-27 23:47:16 +0100 | <Zenen> | Alright, problem solved by changing the field names. |
2024-12-27 23:44:22 +0100 | OftenFaded | (~OftenFade@user/tisktisk) OftenFaded |
2024-12-27 23:43:29 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
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 |