Logs: liberachat/#haskell
| 2021-07-30 05:40:23 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Remote host closed the connection) |
| 2021-07-30 05:40:45 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 2021-07-30 05:42:06 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Ping timeout: 272 seconds) |
| 2021-07-30 05:42:35 | → | trent joins (~trent@2001:8003:340d:d00:b2de:b98:7a93:b0ea) |
| 2021-07-30 05:43:24 | <dsal> | How do you write useful code without records or tuples? |
| 2021-07-30 05:43:51 | <siraben> | Map String a /s |
| 2021-07-30 05:44:13 | <siraben> | hm not polymorphic enough |
| 2021-07-30 05:45:17 | <dsal> | Can I generate lenses with NoFieldSelectors? That sounds kind of nice. |
| 2021-07-30 05:45:28 | <Axman6> | everything is just tuples and Either anyway |
| 2021-07-30 05:45:52 | <siraben> | polynomial functors |
| 2021-07-30 05:45:54 | <Axman6> | dsal: I would be surprised if you couldn't, since they work of the Generic representation |
| 2021-07-30 05:46:31 | → | anandprabhu joins (~anandprab@45.83.220.206) |
| 2021-07-30 05:47:12 | → | michalz joins (~michalz@185.246.204.61) |
| 2021-07-30 05:47:35 | <dsal> | That's pretty cool. Now I just need the feature to automatically export all my lenses |
| 2021-07-30 05:47:40 | <sm> | lechner, I use it all the time, for the readability. Just can't partially apply it |
| 2021-07-30 05:50:24 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 05:51:24 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Quit: FinnElija) |
| 2021-07-30 05:51:30 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-30 05:51:50 | × | anandprabhu quits (~anandprab@45.83.220.206) (Quit: Leaving) |
| 2021-07-30 05:54:20 | <ext0l> | hmm. if i'm using gstreamer bindings, am i guaranteed that the gc will run often enough that i can rely on finalizers actually running? |
| 2021-07-30 05:57:01 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 2021-07-30 05:58:38 | <Axman6> | "gc ... guarantee" no |
| 2021-07-30 05:59:16 | <ext0l> | haha |
| 2021-07-30 06:02:25 | <davean> | sm: To aprtially apply printf you need to give a type signature a lot of the time. |
| 2021-07-30 06:02:42 | <davean> | At least of the partially applied result |
| 2021-07-30 06:20:47 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 2021-07-30 06:21:08 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 258 seconds) |
| 2021-07-30 06:21:59 | Lord_of_Life_ | is now known as Lord_of_Life |
| 2021-07-30 06:24:32 | × | Vajb quits (~Vajb@2001:999:62:1d53:26b1:6c9b:c1ed:9c01) (Read error: Connection reset by peer) |
| 2021-07-30 06:25:55 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-30 06:32:51 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 2021-07-30 06:36:33 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-30 06:39:43 | → | neceve joins (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f) |
| 2021-07-30 06:42:35 | → | sergio812 joins (~sergio812@lfbn-ren-1-403-102.w2-10.abo.wanadoo.fr) |
| 2021-07-30 06:48:40 | → | wei2912 joins (~wei2912@112.199.250.21) |
| 2021-07-30 06:49:13 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:f0d1:c4fb:1626:e1c7) |
| 2021-07-30 06:49:33 | <sm> | davean, for sure - I couldn't find the right one in the past, but sounds like you did - good to know |
| 2021-07-30 06:50:45 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Remote host closed the connection) |
| 2021-07-30 06:51:01 | <sergio812> | Hi,While using |
| 2021-07-30 06:51:06 | <sergio812> | Hi, |
| 2021-07-30 06:51:22 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 06:52:14 | <sergio812> | While using QuickCheck, I happen to need some generator (like https://stackoverflow.com/questions/39291494/only-generate-positive-integers-with-quickcheck), but then shrinking is not applied anymore. What is the workaround? |
| 2021-07-30 06:52:30 | × | ext0l quits (~vector@157-131-102-171.fiber.dynamic.sonic.net) (Quit: WeeChat 3.1) |
| 2021-07-30 06:53:36 | <sergio812> | i.e. with a property "prop_gt_3" that checks that all elements in a list are greater than 3, "quickCheck prop_gt_3" gives the minimal counterexample "[0]" |
| 2021-07-30 06:54:21 | <sergio812> | whereas "quickCheck $ forAll genListOfPos $ prop_gt_3" can give me a (relatively) big couterexample, like "[2,2]" |
| 2021-07-30 06:55:34 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Ping timeout: 256 seconds) |
| 2021-07-30 06:55:34 | <sergio812> | For the record, generator definitions are "genListOfPos = listOf genPos" and "genPos = (arbitrary :: Gen Int) `suchThat` (> 0)" (see the stackoverflow page for type signatures) |
| 2021-07-30 06:57:08 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 252 seconds) |
| 2021-07-30 06:58:26 | × | bitmapper quits (uid464869@id-464869.tooting.irccloud.com) (Quit: Connection closed for inactivity) |
| 2021-07-30 06:59:45 | × | trent quits (~trent@2001:8003:340d:d00:b2de:b98:7a93:b0ea) (Quit: WeeChat 3.1) |
| 2021-07-30 07:00:31 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 2021-07-30 07:00:39 | <sergio812> | [BTW, on the stackoverflow, "genPos" is a spurious "abs `fmap`" at the start of its definition.] |
| 2021-07-30 07:02:43 | <tomsmeding> | sergio812: if you specifically need positive integers, have you tried using Positive? https://hackage.haskell.org/package/QuickCheck-2.14/docs/Test-QuickCheck.html#t:Positive |
| 2021-07-30 07:02:47 | × | shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit) |
| 2021-07-30 07:03:01 | <tomsmeding> | (or NonNegative) |
| 2021-07-30 07:03:52 | → | chele joins (~chele@user/chele) |
| 2021-07-30 07:04:15 | <tomsmeding> | sergio812: the 'fmap abs' is I think taken from the quickcheck implementation of Arbitrary for Positive, which has the crucial difference of being generic over any type that is Ord, Num and Arbitrary |
| 2021-07-30 07:04:44 | <tomsmeding> | then 'abs' is not necessarily guaranteed to produce something that is '> 0', so they do an extra check just to be sure (which makes no difference for Int) |
| 2021-07-30 07:05:27 | → | mattil joins (~mattilinn@87-92-232-85.rev.dnainternet.fi) |
| 2021-07-30 07:05:43 | × | mattil quits (~mattilinn@87-92-232-85.rev.dnainternet.fi) (Remote host closed the connection) |
| 2021-07-30 07:06:05 | → | mattil joins (~mattilinn@87-92-232-85.rev.dnainternet.fi) |
| 2021-07-30 07:06:30 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 2021-07-30 07:07:09 | <sergio812> | tomsmeding: I know "Positive", but I deliberately shied away from it,since generators like "genPos" may produce much funkier data not covered by QuickCheck. |
| 2021-07-30 07:07:40 | × | hueso quits (~root@user/hueso) (Quit: No Ping reply in 210 seconds.) |
| 2021-07-30 07:07:41 | <tomsmeding> | you mean that you actually want a condition more complicated than just '> 0' ? |
| 2021-07-30 07:07:54 | <sergio812> | in the generator, yes |
| 2021-07-30 07:08:16 | <tomsmeding> | consider looking at the implementation of Arbitrary for Positive, perhaps: https://hackage.haskell.org/package/QuickCheck-2.14/docs/src/Test.QuickCheck.Modifiers.html#line-266 |
| 2021-07-30 07:08:35 | <tomsmeding> | they specially implement 'shrink' using shrink on the original value pre-filtering, then mapping abs afterwards |
| 2021-07-30 07:08:50 | <tomsmeding> | s/mapping abs/filtering on >0/ |
| 2021-07-30 07:09:04 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 2021-07-30 07:09:37 | <tomsmeding> | shrink has a default implementation of \_ -> [], so if you want to get shrinking for your custom data type, you'll have to implement 'shrink' somehow |
| 2021-07-30 07:09:58 | → | hueso joins (~root@user/hueso) |
| 2021-07-30 07:09:58 | <sergio812> | Ah, many thanks! |
| 2021-07-30 07:11:05 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds) |
| 2021-07-30 07:11:23 | <tomsmeding> | sergio812: I believe 'hedgehog' (a quickcheck alternative) has a different approach (based on explicit generator objects instead of typeclass instances) that automatically determine shrinking paths from the combinators that you use |
| 2021-07-30 07:12:16 | <sergio812> | tomsmeding: BTW, I didn't quite get your explanation of 'fmap abs' being useful for other types than mere Int. Do you have an example of type which would need 'abs'? |
| 2021-07-30 07:14:57 | → | epolanski joins (uid312403@id-312403.brockwell.irccloud.com) |
| 2021-07-30 07:15:01 | <tomsmeding> | sergio812: no type would _need_ abs, but it might provide a performance improvement |
| 2021-07-30 07:15:21 | <tomsmeding> | just filtering on '> 0' will reject half of the samples, on average, while first applying 'abs' will accept roughly all samples |
| 2021-07-30 07:15:39 | <tomsmeding> | and just applying 'abs' is not enough, since you might generate 0 :0 |
| 2021-07-30 07:15:41 | <tomsmeding> | * :) |
| 2021-07-30 07:16:06 | <tomsmeding> | my remark earlier was wrong |
| 2021-07-30 07:16:08 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 2021-07-30 07:16:36 | → | jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
| 2021-07-30 07:16:50 | <tomsmeding> | (this applies for Int as well) |
| 2021-07-30 07:17:56 | <sergio812> | Got it, thanks! |
| 2021-07-30 07:19:35 | <sergio812> | I got the execution order wrong... |
| 2021-07-30 07:21:21 | → | acidjnk_new joins (~acidjnk@p200300d0c72b9507354aa6404eb54f37.dip0.t-ipconnect.de) |
| 2021-07-30 07:22:30 | <tomsmeding> | sergio812: yeah those inline function applications are confusing without parentheses |
| 2021-07-30 07:22:41 | <tomsmeding> | quickcheck's own definition is more readable :p https://hackage.haskell.org/package/QuickCheck-2.14.2/docs/src/Test.QuickCheck.Modifiers.html#line-266 |
| 2021-07-30 07:23:21 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 2021-07-30 07:26:48 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 2021-07-30 07:28:13 | → | cfricke joins (~cfricke@user/cfricke) |
| 2021-07-30 07:28:22 | → | peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) |
| 2021-07-30 07:29:52 | → | mikoto-chan joins (~mikoto-ch@ip-193-121-10-50.dsl.scarlet.be) |
| 2021-07-30 07:30:24 | × | EvanR quits (~evan@user/evanr) (Ping timeout: 252 seconds) |
| 2021-07-30 07:32:52 | × | jamestmartin quits (~james@jtmar.me) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
| 2021-07-30 07:32:53 | × | arkeet quits (~arkeet@moriya.ca) (Remote host closed the connection) |
| 2021-07-30 07:33:01 | → | jamestmartin joins (james@jtmar.me) |
| 2021-07-30 07:33:07 | → | arkeet joins (arkeet@moriya.ca) |
All times are in UTC.