Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-29 18:48:21 <monochrom> Is it possible to invent a new language, let's call it "mix", which improves upon the nix language by adding a proper module system, and you can still use the rest of the nix infrastructure?
2021-04-29 18:49:05 <DigitalKiwi> https://www.thejach.com/imgs/vim_learning.jpg
2021-04-29 18:49:06 <monochrom> Or generally it is only the nix language that needs fixing so let's replace just that.
2021-04-29 18:49:06 <maerwald> Hmm, lets see: a) reproducable builds? Never needed it (except for an embedded project, but there we used a proprietary alternative), b) reproducible environment? Cool, but don't remember when I actually needed that and couldn't do without, c) nixops? More trouble than all the alternatives
2021-04-29 18:49:36 <DigitalKiwi> monochrom: well there is guix
2021-04-29 18:50:44 <DigitalKiwi> maerwald: do you find ghcup useful?
2021-04-29 18:50:45 <maerwald> in the end, static binaries are better for user-facing things and when you're deploying... why would you need reproducible config? Do you not have full control over the environment anyway?
2021-04-29 18:51:23 bor0 joins (~boro@unaffiliated/boro/x-000000001)
2021-04-29 18:51:49 <maerwald> DigitalKiwi: ghcup is a low-effort tool, but has high ergonomics... so basically the opposite of nix
2021-04-29 18:52:14 <maerwald> so it's useful when your distro GHC is broken/lagging
2021-04-29 18:52:23 <maerwald> which happens to be the case for many distros
2021-04-29 18:54:33 × bor0 quits (~boro@unaffiliated/boro/x-000000001) (Client Quit)
2021-04-29 18:54:56 × hypercube quits (~hypercube@2603-6011-f901-9e5b-0000-0000-0000-08cf.res6.spectrum.com) (Quit: WeeChat 3.1)
2021-04-29 18:55:20 <slack1256> Is there a testing flag in cabal so I can test non exported functions from a module?
2021-04-29 18:55:44 <slack1256> ghci does have that via `:m *MyModule`
2021-04-29 18:55:55 <maerwald> slack1256: you can do cpp and write the test within the module and export the test
2021-04-29 18:56:02 <maerwald> `tar` did that previously
2021-04-29 18:56:20 <geekosaur> non exported functions requires interpretation, which ghci can do but cabal can't (nor ghc in general)
2021-04-29 18:56:45 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 252 seconds)
2021-04-29 18:56:47 <slack1256> maerwald: That actually sounds great.
2021-04-29 18:57:28 <DigitalKiwi> nix-shell -I nixpkgs=channel:nixos-unstable -p cabal-install zlib git -p "haskell.packages.ghc8104.ghcWithPackages(pkgs: with pkgs; [ monad-loops xlsx shh shh-extras HSH simple-cmd shelly megaparsec aeson titlecase ])"
2021-04-29 18:57:32 <geekosaur> the other way to do it is an Internals module which is exported
2021-04-29 18:57:36 <maerwald> slack1256: https://github.com/haskell/tar/blob/557014f2a441e3b9372e5d30b437fe50cdf190bc/Codec/Archive/Tar/Index/IntTrie.hs#L507
2021-04-29 18:58:03 <maerwald> not sure if that's great... I'd personally just export everything and use the `Foo.Internal.Bar` notation for the module
2021-04-29 18:58:19 <maerwald> (and then exclude changes to those modules from your PVP process)
2021-04-29 18:58:34 <maerwald> like geekosaur said
2021-04-29 18:58:46 <DigitalKiwi> https://mostlyabsurd.com/files/2021-04-25-174331_2879x1694_scrot.png
2021-04-29 18:59:38 <maerwald> maybe you can do without the CPP, but then you always build the tests, which is a little odd maybe
2021-04-29 18:59:48 <maerwald> or not, sounds radical
2021-04-29 19:00:38 <maerwald> (you lose caching with the CPP when you switch to building the tests)
2021-04-29 19:00:56 <slack1256> Exactly.
2021-04-29 19:01:18 <monochrom> On the bright side, at equilibrium both are cached. >:)
2021-04-29 19:01:25 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2021-04-29 19:01:57 <DigitalKiwi> https://mostlyabsurd.com/files/binance
2021-04-29 19:02:00 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-04-29 19:02:26 × whatisRT quits (~whatisRT@ip5b416a33.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds)
2021-04-29 19:02:43 <DigitalKiwi> https://mostlyabsurd.com/files/clone-edward
2021-04-29 19:03:41 × kami_ quits (~kami@228.243.254.87.static.monaco.mc) (Remote host closed the connection)
2021-04-29 19:03:43 <maerwald> hmm, PVP could have included a rule for modules that contain `Internal` in their name to be excluded from the API check
2021-04-29 19:03:45 <monochrom> great name "clone-edward".
2021-04-29 19:04:03 <DigitalKiwi> https://gist.github.com/Kiwi/ffc08bffb15798dc4b1ec2a1c47c6191#file-program-cabal-hs
2021-04-29 19:04:06 whatisRT joins (~whatisRT@ip5b416a33.dynamic.kabel-deutschland.de)
2021-04-29 19:05:04 <maerwald> but the PVP author is awol
2021-04-29 19:05:43 <monochrom> I think people already interpret PVP with that in mind.
2021-04-29 19:06:38 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
2021-04-29 19:06:45 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
2021-04-29 19:06:57 <maerwald> I guess we can pester haskell foundation about PVP updates
2021-04-29 19:07:02 jamm_ joins (~jamm@unaffiliated/jamm)
2021-04-29 19:07:31 <monochrom> I am actually doubtful about the value of making it an explicit statement.
2021-04-29 19:07:32 Tario joins (~Tario@201.192.165.173)
2021-04-29 19:07:43 <maerwald> well, tools can use that information then
2021-04-29 19:07:48 <maerwald> otherwise it's kinda illegal!
2021-04-29 19:08:15 <maerwald> but not sure we even have a mature PVP checker? I remeber some
2021-04-29 19:08:32 <maerwald> @hackage policeman
2021-04-29 19:08:32 <lambdabot> https://hackage.haskell.org/package/policeman
2021-04-29 19:08:32 whatisRT- joins (~whatisRT@ip5b416a33.dynamic.kabel-deutschland.de)
2021-04-29 19:08:52 × whatisRT quits (~whatisRT@ip5b416a33.dynamic.kabel-deutschland.de) (Ping timeout: 252 seconds)
2021-04-29 19:10:37 rj joins (~x@gateway/tor-sasl/rj)
2021-04-29 19:13:40 elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)
2021-04-29 19:15:02 ddellac__ joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-29 19:15:34 × daniil quits (8967c375@d-137-103-195-117.fl.cpe.atlanticbb.net) (Quit: Connection closed)
2021-04-29 19:17:17 × joncol quits (~jco@c83-248-173-38.bredband.comhem.se) (Remote host closed the connection)
2021-04-29 19:17:58 hypercube joins (~hypercube@2603-6011-f901-9e5b-0000-0000-0000-08cf.res6.spectrum.com)
2021-04-29 19:18:12 × stree quits (~stree@68.36.8.116) (Ping timeout: 240 seconds)
2021-04-29 19:18:32 × shailangsa quits (~shailangs@host217-35-224-169.range217-35.btcentralplus.com) (Ping timeout: 246 seconds)
2021-04-29 19:19:11 × ddellac__ quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds)
2021-04-29 19:24:29 jgt joins (~jgt@88.225.221.135)
2021-04-29 19:24:55 × jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
2021-04-29 19:26:27 philderbeast joins (~textual@bras-base-vldvpq5901w-grc-06-184-144-244-252.dsl.bell.ca)
2021-04-29 19:29:41 × jgt quits (~jgt@88.225.221.135) (Ping timeout: 240 seconds)
2021-04-29 19:30:26 × juuandyy quits (~juuandyy@90.106.228.121) (Quit: Konversation terminated!)
2021-04-29 19:30:52 × Narinas quits (~Narinas@187-178-93-112.dynamic.axtel.net) (Ping timeout: 240 seconds)
2021-04-29 19:30:54 <juri_> ok, dumb question. if i'm writing a function definition and using typeclasses to restrict the type of two items, how do i specify that two of the items have the same restrictions, even though they are not the same type?
2021-04-29 19:31:11 argento joins (~argent0@168.227.97.34)
2021-04-29 19:31:30 <Rembane> juri_: Give them two different type variables.
2021-04-29 19:31:30 stree joins (~stree@68.36.8.116)
2021-04-29 19:31:47 <juri_> right now i have averageNodes :: (Arcable a, Pointable a, Show a, Arcable b, Pointable b, Show b) => a -> b -> INode
2021-04-29 19:32:04 <juri_> how would i re-write that shorter?
2021-04-29 19:37:41 × loller_ quits (uid358106@gateway/web/irccloud.com/x-yykgptajeudcaatj) (Quit: Connection closed for inactivity)
2021-04-29 19:38:32 × minoru_shiraeesh quits (~shiraeesh@46.34.207.120) (Ping timeout: 240 seconds)
2021-04-29 19:38:36 × Pickchea quits (~private@unaffiliated/pickchea) (Quit: Leaving)
2021-04-29 19:38:46 minoru_shiraeesh joins (~shiraeesh@5.101.59.47)
2021-04-29 19:38:56 <davean> juri_: if its a thing you do often, you'd create an alias that covered the 3 pieces
2021-04-29 19:38:57 <monochrom> Define your own "class (Arcable a, Pointable a, Show a) => ProblemSpecific a". It needs no methods.
2021-04-29 19:39:03 <davean> Doesn't need to be a class
2021-04-29 19:39:48 <monochrom> The non-class solution breaks a lot of people's minds, so I won't tell it unless you really want to see it.
2021-04-29 19:40:27 <davean> really? How does it break people's minds?
2021-04-29 19:40:27 <DigitalKiwi> ...me would like to see it
2021-04-29 19:40:36 Eoco joins (~ian@x-160-94-179-157.acm.umn.edu)
2021-04-29 19:40:37 <Rembane> monochrom, davean: I want to see it! :)
2021-04-29 19:40:54 <monochrom> Turn on ContraintKinds. Then "type ProblemSpecific a = (Arcable a, Pointable a, Show a)".
2021-04-29 19:41:16 desophos joins (~desophos@2601:249:1680:a570:2805:692e:a4c7:e255)
2021-04-29 19:41:36 <monochrom> Major motivating example in the GHC user's guide in the ConstraintKinds section.
2021-04-29 19:41:42 <davean> it seems the much more simple and straight forward approach to me, its what I sue when I've got a meta set of constraints I use a lot
2021-04-29 19:42:03 <Rembane> Is ConstraintKinds one of the nice extensions?
2021-04-29 19:42:17 <monochrom> I think it's harmless.
2021-04-29 19:42:54 <monochrom> There are a lot of simple one-liners that break a lot of people's minds.
2021-04-29 19:43:11 × Aquazi quits (uid312403@gateway/web/irccloud.com/x-bpamshvzisvwzxre) (Quit: Connection closed for inactivity)
2021-04-29 19:43:18 <Rembane> That's good stuff
2021-04-29 19:43:25 <monochrom> I optimize for "I understand the solution" not "the solution is slick".

All times are in UTC.