question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`map` forgets its shrinker

See original GitHub issue

For example:

Gen.string().shrinker != null
Gen.string().map { it }.shrinker() == null

This means we don’t get a free shrinker when combining Gens. Moreover, it is surprising behaviour for users since it violates the functor law for map.

If it cannot be implemented without breaking covariance, then I think shrinker() should be removed from the Gen interface, and Gen should go back to being covariant.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:24 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
sksamuelcommented, Nov 16, 2018

Yes that’s one solution I suppose.

If I want to write a custom generator for strings, then I can either lose shrinker support, wrap the type in a data class, or have an overloaded forAll that accepts a specific shrinker. Out of those, I don’t think there’s much to choose between the last two, in that they’re both not ideal, but I do think they’re probably both better than the current situation.

0reactions
LeoColmancommented, Dec 27, 2019

Closed as per #1135

Read more comments on GitHub >

github_iconTop Results From Across the Web

if you could SHRINK in Minecraft - YouTube
Your browser can't play this video. ... Shrink Parkour is an awesome minecraft parkour map where you can shrink in size to solve...
Read more >
Minecraft: WE SHRINK!!! - CRACK THE LOO - Custom Map [1]
We are super tiny!!!Jen's Channel http://youtube.com/gamingwithjenEPIC SHIRTS! Shirts! https://represent.com/store/popularmmosDon't forget ...
Read more >
Shrinking Sections of the Map? : r/inkarnate - Reddit
Is there a way I can take a section of the map and shrink it down? ... Forget expanding the map add more...
Read more >
Mercator Misconceptions: Clever Map Shows the True Size of ...
The world map you know is totally wrong. Check out this clever graphic, which helps put into perspective the true size of countries....
Read more >
Your Mental World Map Is Wrong. Here's the Right One.
For the last 500 years, a certain kind of world map has been used to teach children about our planet. But forget everything...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found