Simplify arbitrary instances for map and set#1166
Simplify arbitrary instances for map and set#1166L0neGamer wants to merge 2 commits intohaskell:masterfrom
Conversation
| pure $ case mIsFirst of | ||
| Just True -> ((x : ls), rs) | ||
| Just False -> (ls, (x : rs)) | ||
| Nothing -> ((x : ls), (x : rs)) |
There was a problem hiding this comment.
This seems strictly less clear. It also produces more "both" results than the current code, which might be fine.
There was a problem hiding this comment.
If you don't want another type, you could do something basic with rem inline.
There was a problem hiding this comment.
I would prefer a more numeric approach, I think that makes more sense than the ternary data types here.
| TwoLists l r <- arbitrary | ||
| (l, r) <- sized $ \sz0 -> do | ||
| sz <- choose (0, sz0) | ||
| let universe = [0,3..3*(sz - 1)] |
There was a problem hiding this comment.
I know I wrote the original code, but I no longer remember the purpose of using products of 3. Has your work here given you any hints?
There was a problem hiding this comment.
Not immediately; I would presume because they're not incredibly densely packed that lets other manipulations happen, but I can't say for certain.
There was a problem hiding this comment.
Yeah, I think it's probably to get some gaps for testing with values in neither? I can't imagine that's the best way to do it; Please feel free to do something else about that.
| {-# LANGUAGE TypeOperators #-} | ||
| {-# LANGUAGE TypeFamilies #-} |
There was a problem hiding this comment.
As brought up in #1165, we would like to get tests working with MHS, which does not support type families. So this is potentially setting up a future problem.
|
Why close this? |
|
I don't think I'm able to commit to bringing this further usefully, and I don't feel strongly enough about it. |
These are over-complicated for what they need to do.