Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-04 15:04:28 <ski> hm
2021-03-04 15:04:35 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Remote host closed the connection)
2021-03-04 15:04:38 <dolio> And you don't try to use type classes for the whole thing.
2021-03-04 15:04:48 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-04 15:04:55 <ski> @dice 1d0
2021-03-04 15:04:55 <lambdabot> unexpected 'd': expecting digit, operator or end of input
2021-03-04 15:05:07 <ski> (that used to give `1', i think ?)
2021-03-04 15:05:31 <maralorn> ghc-pkg list shows me two different directories. I have a library in both directories. When I build my package the library version from the wrong dir is being used. How can I change the precedence of the two directories?
2021-03-04 15:06:24 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:41d3:e796:cd7:d5b3) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-03-04 15:06:39 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Remote host closed the connection)
2021-03-04 15:07:23 × Trasp quits (~Trasp@195.140.213.38) (Remote host closed the connection)
2021-03-04 15:09:11 <int-e> dolio: that would fit into typeclasses, if you'd change `arbitrary` to return a Maybe
2021-03-04 15:09:26 <dolio> It doesn't.
2021-03-04 15:10:27 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-04 15:10:55 <int-e> I think it does. The instances would have to do more work though... check which alternatives are impossible before choosing a constructor. So it's a nontrivial change.
2021-03-04 15:11:19 <dolio> No, I mean, you can't change the Arbitrary class to be that way. It's too late.
2021-03-04 15:11:31 <int-e> Sure
2021-03-04 15:13:48 <dolio> It would also mean that something having an Arbitrary instance doesn't mean you can generate them for tests, so it's probably better if it's a different class.
2021-03-04 15:14:35 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Ping timeout: 240 seconds)
2021-03-04 15:14:43 <dolio> Or just not a class.
2021-03-04 15:15:27 <int-e> What I had in mind would be a new, QuickCheck-like package. *Maybe* with a newtype wrapper that has a QuickCheck Arbitrary instance based on the new class(es).
2021-03-04 15:16:41 <merijn> hedgehog?
2021-03-04 15:16:46 <int-e> (Can we capture emptiness in a constraint? Probably?)
2021-03-04 15:16:48 <merijn> That uses explicit generators
2021-03-04 15:17:06 ski . o O ( `newtype Arb a = MkArb (Maybe a)' )
2021-03-04 15:18:27 <int-e> ski: Yeah but I don't like the idea of generating Nothings... if you use Void a lot that will end up wasting a lot of resources before you get a usable value.
2021-03-04 15:19:01 <int-e> ski: So I'd prefer to capture emptiness of types statically. But that is a bigger change.
2021-03-04 15:19:57 <int-e> "statically"
2021-03-04 15:20:35 × drupol quits (sid117588@gateway/web/irccloud.com/x-rzrwwjpiqonmqeqo) ()
2021-03-04 15:20:51 drupol joins (sid117588@gateway/web/irccloud.com/x-ceggwpmvzndzubky)
2021-03-04 15:21:14 <dolio> Like, why do you need to track that compound types don't have a generator? Is that a real use case? or is the use case that `Foo Void` is the 'closed' Foos, and you only need to handle that one case?
2021-03-04 15:21:28 <dolio> Because the latter is what I've encountered.
2021-03-04 15:21:35 <int-e> ski: you don't have to go crazy for this to become problematic, just consider [Either Void Int]
2021-03-04 15:22:00 <dolio> And redesigning everything is not desirable for that.
2021-03-04 15:23:17 Wolfy87 joins (~Wolfy87@178.239.168.171)
2021-03-04 15:24:10 <dolio> E.G. generating `Either Void Bool` automatically is not a real example.
2021-03-04 15:24:27 <int-e> dolio: But it would be a proper solution. Yes, it's quite possible that the proper solution is too costly to be worthwhile because it breaks a lot of existing tooling.
2021-03-04 15:25:32 × Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection)
2021-03-04 15:26:01 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
2021-03-04 15:26:23 <ski> int-e : yea, i meant being able to check it, before generation, if possible
2021-03-04 15:27:00 <ski> int-e : well, you said "*Maybe* with a newtype wrapper"
2021-03-04 15:27:16 <ski> (so i was wondering if you meant something like such an `Arb')
2021-03-04 15:28:09 × DataComputist quits (~lumeng@50.43.26.251) (Quit: Leaving...)
2021-03-04 15:29:01 <int-e> ski: Ah. I see. In my mind I didn't have the Maybe, but rather instance (NonEmpty a, NewArbitrary a) => Arbitrary (Arb a)
2021-03-04 15:29:44 <dolio> I don't agree that a solution is 'proper' if it's just solving corner cases that people don't actually want to use at the expense of making the cases they do want more work.
2021-03-04 15:31:56 <int-e> ski: But it's quite possible that I can't get such a neat NonEmpty constraint without terrible things (overlapping instances)
2021-03-04 15:35:55 <infinisil> I'll see if I can dig into the code that requires this arbitrary instance
2021-03-04 15:36:31 kiweun joins (~kiweun@dsl-173-206-6-91.tor.primus.ca)
2021-03-04 15:36:41 × stree quits (~stree@68.36.8.116) (Ping timeout: 265 seconds)
2021-03-04 15:37:01 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2021-03-04 15:38:11 kw joins (d4662d5d@212.102.45.93)
2021-03-04 15:39:00 × kw quits (d4662d5d@212.102.45.93) (Client Quit)
2021-03-04 15:44:38 aggin joins (~ecm@103.88.87.27)
2021-03-04 15:44:38 __minoru__shirae joins (~shiraeesh@46.34.206.213)
2021-03-04 15:44:47 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-04 15:46:07 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Remote host closed the connection)
2021-03-04 15:46:58 × aggin quits (~ecm@103.88.87.27) (Client Quit)
2021-03-04 15:47:07 nineonine joins (~nineonine@2604:3d08:7785:9600:2076:7626:28f5:58b2)
2021-03-04 15:48:08 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-03-04 15:49:47 stree joins (~stree@68.36.8.116)
2021-03-04 15:50:16 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2021-03-04 15:50:53 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
2021-03-04 15:50:59 × xff0x quits (~xff0x@2001:1a81:5237:bb00:76ab:515a:5e02:6571) (Ping timeout: 258 seconds)
2021-03-04 15:51:15 × nineonine quits (~nineonine@2604:3d08:7785:9600:2076:7626:28f5:58b2) (Ping timeout: 240 seconds)
2021-03-04 15:51:48 xff0x joins (~xff0x@2001:1a81:5237:bb00:c7c4:8fca:bda7:8993)
2021-03-04 15:53:00 <infinisil> It's using ` (Arbitrary a, Show a, Testable prop) => Testable (a -> prop) ` in the end
2021-03-04 15:53:12 <infinisil> With `testProperty :: Testable a => TestName -> a -> TestTree`
2021-03-04 15:53:29 <infinisil> Where the `a` in `a -> prop` is the uninhabited type
2021-03-04 15:53:56 <infinisil> Maybe there should be an instance `Testable (Void -> b)`
2021-03-04 15:56:10 <infinisil> https://hackage.haskell.org/package/tasty-quickcheck-0.10.1.2/docs/Test-Tasty-QuickCheck.html#v:testProperty
2021-03-04 15:56:58 ggole joins (~ggole@2001:8003:8119:7200:9a:455d:b816:c3c6)
2021-03-04 15:57:58 <infinisil> (though it would be bothersome to have to replace all `Arbitrary a` constraints with `Testable (a -> Property)` then
2021-03-04 15:58:32 <ij> what's the haskell equivalent to scala's FunctorK? (i.e. mapping the higher order type – F a -> G a)
2021-03-04 15:58:50 <infinisil> Oh interesting: https://hackage.haskell.org/package/quickcheck-instances-0.3.25.2/docs/Test-QuickCheck-Instances-Void.html
2021-03-04 15:59:01 <infinisil> There's a `CoArbitrary Void` instance
2021-03-04 16:00:07 × mentaal[m] quits (mentaalmat@gateway/shell/matrix.org/x-cldzerqnoqwflcto) (Quit: Idle for 30+ days)
2021-03-04 16:00:44 polyphem joins (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889)
2021-03-04 16:01:30 <infinisil> And there's `Fun` with this instance: (Function a, CoArbitrary a, Arbitrary b) => Arbitrary (Fun a b)
2021-03-04 16:01:41 <infinisil> That would work, maybe tasty should be using that instead
2021-03-04 16:01:48 <infinisil> tasty-quickcheck*
2021-03-04 16:01:55 <shapr> ij: I don't understand what FunctorK does?
2021-03-04 16:02:15 <infinisil> Or rather, the code that tests this
2021-03-04 16:02:21 jhaxim joins (c036de94@192.54.222.148)
2021-03-04 16:02:29 <jhaxim> why are queues in haskell implemented as 2 lists?
2021-03-04 16:02:58 <dolio> Some are implemented with 3 lists.
2021-03-04 16:03:09 × __minoru__shirae quits (~shiraeesh@46.34.206.213) (Ping timeout: 260 seconds)
2021-03-04 16:03:16 <jhaxim> how do you do it with 3?
2021-03-04 16:03:29 <jhaxim> what's the added benefit
2021-03-04 16:04:12 <dolio> It spreads out the cost of reversing one of the lists.
2021-03-04 16:04:45 <jhaxim> how does it work?
2021-03-04 16:05:56 <infinisil> Okay I'm thinking that tasty-quickchecks `(Arbitrary a, Show a, Testable prop) => Testable (a -> prop)` instance should really use `CoArbitrary a` instead now
2021-03-04 16:06:33 hnOsmium0001 joins (uid453710@gateway/web/irccloud.com/x-sggshpbcjtfntjhq)
2021-03-04 16:06:49 <ski> infinisil ?
2021-03-04 16:07:02 <infinisil> Hm?
2021-03-04 16:07:45 <ski> i guess `Testable (Void -> b)' would always succeed, after zero tests ..
2021-03-04 16:07:46 <dolio> jhaxim: https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf
2021-03-04 16:08:07 <dolio> The 3 list one is explained in the "Real-Time Queues" section I think.
2021-03-04 16:08:11 <infinisil> ski: Yeah
2021-03-04 16:08:35 <ski> `CoArbitrary Void' is for being able to derive `Arbitrary (Void -> a)', from `Arbitrary `a'
2021-03-04 16:08:52 <ski> @where okasaki

All times are in UTC.