Logs: freenode/#haskell
| 2020-11-21 14:33:30 | → | aldessa joins (~hugh@host-92-27-117-235.static.as13285.net) |
| 2020-11-21 14:33:50 | × | Audentity quits (~Audentity@4e69b241.skybroadband.com) (Ping timeout: 265 seconds) |
| 2020-11-21 14:36:10 | → | Audentity joins (~Audentity@4e69b241.skybroadband.com) |
| 2020-11-21 14:37:13 | × | Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 246 seconds) |
| 2020-11-21 14:37:17 | <Feuermagier> | merijn, how would I check every entry in the map for my "only once" condition? |
| 2020-11-21 14:37:52 | <merijn> | Feuermagier: Pretty sure there are some index maps/folds |
| 2020-11-21 14:38:00 | <merijn> | and also filters? |
| 2020-11-21 14:38:05 | <Feuermagier> | rgr. will take a look at those |
| 2020-11-21 14:38:16 | × | darjeeling_ quits (~darjeelin@122.245.211.11) (Ping timeout: 246 seconds) |
| 2020-11-21 14:38:17 | <merijn> | Feuermagier: Just filter out everything with value 1 and check if the result is empty |
| 2020-11-21 14:38:49 | → | czwartyeon joins (4d2d3763@77-45-55-99.sta.asta-net.com.pl) |
| 2020-11-21 14:39:13 | × | mputz quits (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) (Ping timeout: 264 seconds) |
| 2020-11-21 14:39:23 | × | texasmynsted quits (~texasmyns@212.102.45.109) (Remote host closed the connection) |
| 2020-11-21 14:39:38 | → | texasmynsted joins (~texasmyns@212.102.45.109) |
| 2020-11-21 14:40:35 | → | zyklotomic joins (~ethan@unaffiliated/chocopuff) |
| 2020-11-21 14:40:45 | × | elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 256 seconds) |
| 2020-11-21 14:40:56 | <zyklotomic> | is there any reason why ghc doesn't automatically derive functor and applicative |
| 2020-11-21 14:40:56 | <aldessa> | are there any haskell libraries for dynamic programming or integer programming that can be recommended? i'm trying to pack n cuboids and think i can formulate it as an integer programming problem |
| 2020-11-21 14:41:18 | <zyklotomic> | *if you define monad |
| 2020-11-21 14:41:45 | <Uniaika> | hmm |
| 2020-11-21 14:41:57 | <Uniaika> | maybe we could put a rule for Monad |
| 2020-11-21 14:42:03 | <maralorn> | jophish: Well, more tests are better tests! Of course the first step would be to get the hls unit tests working in nixpkgs, (as well as dependencies like ghcide, etc,.) I am nearly there for hls but there are two tests which run into timeouts so I disabled them for now. |
| 2020-11-21 14:42:20 | <Uniaika> | zyklotomic: historically, Applicative was not so tightly linked to Monad |
| 2020-11-21 14:42:25 | <Uniaika> | now it is the case |
| 2020-11-21 14:42:29 | <Uniaika> | this could indeed change |
| 2020-11-21 14:42:30 | <zyklotomic> | yeah, I am following the historical aspect of it |
| 2020-11-21 14:42:43 | <zyklotomic> | is it a matter of not having gotten to it yet? |
| 2020-11-21 14:42:53 | <zyklotomic> | or is there a reason why we might not want it to behave that way |
| 2020-11-21 14:42:57 | <Uniaika> | zyklotomic: can you open a ticket on https://gitlab.haskell.org/ghc/ghc/-/issues/new ? |
| 2020-11-21 14:43:32 | <zyklotomic> | I'm just a beginner, I'm not very confident on how valid this opinion is though lol |
| 2020-11-21 14:44:11 | <geekosaur> | deriving applicative might be because some types have more than one valid applicative (see ZipList) |
| 2020-11-21 14:44:21 | → | Tario joins (~Tario@201.192.165.173) |
| 2020-11-21 14:44:21 | <merijn> | zyklotomic: You can't automatically derive Applicative |
| 2020-11-21 14:44:46 | <merijn> | Functors are possible because lawful functors are unique |
| 2020-11-21 14:45:13 | <zyklotomic> | I understand that they might not be unique, but what if you just wanted to use the Monad definition |
| 2020-11-21 14:45:14 | → | lucasb joins (uid333435@gateway/web/irccloud.com/x-ssbbedmexymeqbgx) |
| 2020-11-21 14:45:17 | <merijn> | Uniaika: What would that ticket be for? |
| 2020-11-21 14:45:25 | <merijn> | zyklotomic: You can |
| 2020-11-21 14:45:36 | × | bitmagie quits (~Thunderbi@200116b806771200992cad3b603b96ee.dip.versatel-1u1.de) (Quit: bitmagie) |
| 2020-11-21 14:45:51 | <zyklotomic> | It is just a minor question, I was wondering why it wasn't the default to be able to do something like filling that boiler plate in fro you |
| 2020-11-21 14:45:51 | <merijn> | If you implement Monad you can just define Applicative as "<*> = ap" |
| 2020-11-21 14:45:52 | → | sondr3_ joins (~sondr3@cm-84.211.56.132.getinternet.no) |
| 2020-11-21 14:46:00 | <zyklotomic> | the "pure = return", "(<*>) = ap" |
| 2020-11-21 14:46:06 | <Uniaika> | merijn: become a URL we can link to people where GHC developers explain why we can or cannot automagically derive Applicative and Functor when one only derives Monad |
| 2020-11-21 14:46:18 | <merijn> | zyklotomic: Because it'd 1) break things and 2) return is planned to be removed from the class |
| 2020-11-21 14:46:43 | <merijn> | Uniaika: You can derive functor even without Monad :p |
| 2020-11-21 14:46:49 | <merijn> | Just enable -XDeriveFunctor |
| 2020-11-21 14:46:57 | <maralorn> | jophish: I am not very experienced with nixos tests, but the test you suggested seems a bit brittle. It looks like it would fail if e.g. the error message was improved or something in the plugin layouts. |
| 2020-11-21 14:47:12 | <Uniaika> | merijn: but can you derive Monad without Functor? :P |
| 2020-11-21 14:47:21 | <jophish> | yeah, I certainly wouldn't want to use it as it is! |
| 2020-11-21 14:47:26 | <Uniaika> | that's what I was talking about |
| 2020-11-21 14:47:28 | <sondr3_> | I'm writing a parser in Haskell to practice and want to test private parts of the code, in Rust this is easy by either testing in the same file as the code, or declaring things to be pub(crate). How can I do something like this in Haskell? |
| 2020-11-21 14:47:28 | <zyklotomic> | yeah my question isnt' the automagically part |
| 2020-11-21 14:47:43 | <jophish> | tbh, posting the link to my specific test was irrelevant, |
| 2020-11-21 14:48:02 | <zyklotomic> | but like why it can't fill in the "(<*>) = ap" for you by default, how would it break things merijn |
| 2020-11-21 14:48:03 | <merijn> | sondr3_: Are you using cabal-install or stack? |
| 2020-11-21 14:48:16 | <sondr3_> | merijn: cabal |
| 2020-11-21 14:48:28 | <zyklotomic> | i'm asking cause i dont see where, not that i disagree |
| 2020-11-21 14:48:30 | <merijn> | sondr3_: Ok, then you can't quite do the same, but there's some tricks |
| 2020-11-21 14:48:46 | <merijn> | sondr3_: So, in recent versions of the cabal spec you can define multiple internal libraries |
| 2020-11-21 14:48:59 | <sondr3_> | I'm open to move to Stack tbh, I've had a bunch of annoyances with cabal |
| 2020-11-21 14:49:03 | <merijn> | sondr3_: So you could define the core logic in an internal library that exports all internals |
| 2020-11-21 14:49:29 | <merijn> | sondr3_: then your public library can re-export the "public" parts of the internal lib and your tests can depend on the internal version |
| 2020-11-21 14:49:46 | <sondr3_> | merijn: Ooh, that's clever, thanks |
| 2020-11-21 14:50:18 | → | urodna joins (~urodna@unaffiliated/urodna) |
| 2020-11-21 14:50:36 | <merijn> | sondr3_: I'm just not sure how well/if stack supports that, hence the question :) |
| 2020-11-21 14:51:05 | <merijn> | sondr3_: https://cabal.readthedocs.io/en/latest/cabal-package.html#sublibs |
| 2020-11-21 14:51:07 | → | et09 joins (~et09@unaffiliated/endolphin) |
| 2020-11-21 14:51:26 | <sondr3_> | merijn: Ah, fair. Thanks for the pointer, I'll give it a go |
| 2020-11-21 14:51:36 | <yushyin> | are multiple *internal* libraries that recent? |
| 2020-11-21 14:51:49 | × | geekosaur quits (ac3a3e89@172.58.62.137) (Remote host closed the connection) |
| 2020-11-21 14:51:49 | <yushyin> | oh 2.0 |
| 2020-11-21 14:51:50 | × | neiluj quits (~jco@unaffiliated/neiluj) (Quit: leaving) |
| 2020-11-21 14:51:55 | → | Deide joins (~Deide@217.155.19.23) |
| 2020-11-21 14:52:02 | → | darjeeling_ joins (~darjeelin@122.245.219.209) |
| 2020-11-21 14:53:07 | × | czwartyeon quits (4d2d3763@77-45-55-99.sta.asta-net.com.pl) (Remote host closed the connection) |
| 2020-11-21 14:53:12 | <merijn> | yushyin: No, but stack is...opinionated on what part of Cabal they wish to support |
| 2020-11-21 14:53:21 | <merijn> | sondr3_: btw, I'm curious which annoyances you had with cabal-install? |
| 2020-11-21 14:53:38 | × | aldessa quits (~hugh@host-92-27-117-235.static.as13285.net) (Read error: Connection reset by peer) |
| 2020-11-21 14:54:33 | <Uniaika> | merijn: I think you can insert verbatim stuff in package.yaml? |
| 2020-11-21 14:55:00 | <merijn> | package.yaml /= stack |
| 2020-11-21 14:55:04 | <sondr3_> | merijn: Mostly getting cabal repl to properly use my project local .ghci file, I want to set OverloadedStrings and load a module |
| 2020-11-21 14:55:26 | <merijn> | sondr3_: Oh, I just have those extensions set in my global .ghci file :) |
| 2020-11-21 14:55:27 | <yushyin> | merijn: yes :/ I switched back from stack to cabal because of similar reasons |
| 2020-11-21 14:55:53 | <merijn> | package.yaml is hpack and hpack is a huge mistake, imo |
| 2020-11-21 14:56:10 | <sondr3_> | merijn: Yeah I'm considering doing the same, it'd just be nice to have it work locally |
| 2020-11-21 14:56:28 | → | Saukk joins (~Saukk@2001:998:f9:2914:1c59:9bb5:b94c:4) |
| 2020-11-21 14:56:33 | <Uniaika> | merijn: my bad indeed |
| 2020-11-21 14:57:13 | → | czwartyeon joins (4d2d3763@77-45-55-99.sta.asta-net.com.pl) |
| 2020-11-21 14:57:16 | <merijn> | Uniaika: stack automatically uses hpack if needed, leading many people to consider it part of stack, but even Snoyman now recommends against relying on only package.yaml and recommends committing the generated .cabal file |
| 2020-11-21 14:58:02 | × | Fractalis quits (~Fractalis@2601:987:280:8d40:ddfc:6164:f3c:5c24) (Ping timeout: 260 seconds) |
| 2020-11-21 14:58:11 | <Uniaika> | merijn: oh yeah we do it at work now |
| 2020-11-21 14:58:28 | <Uniaika> | latest stack versions give you a warning |
| 2020-11-21 14:58:49 | × | perry69420 quits (6ee39737@110.227.151.55) (Ping timeout: 245 seconds) |
| 2020-11-21 14:59:46 | <merijn> | Like, I get why people like hpack, because they get to be lazy. But there's a reason why cabal-install doesn't allow you to be lazy. Being lazy turns your package management, distribution, and archiving into a huge unfixable clusterfuck |
| 2020-11-21 14:59:54 | <merijn> | This is why pip and npm are such insane messes |
| 2020-11-21 15:00:02 | × | p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Ping timeout: 260 seconds) |
| 2020-11-21 15:00:18 | <zyklotomic> | huh what makes npm and pip bad |
| 2020-11-21 15:00:30 | → | p-core joins (~Thunderbi@2a0e:1c80:4:1024::1007) |
| 2020-11-21 15:00:55 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
All times are in UTC.