Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianAlgehed committed Apr 25, 2024
1 parent d24ef53 commit 71ba341
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/constrained-generators/src/Constrained/Spec/Map.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ data MapSpec fn k v = MapSpec
, mapSpecFold :: FoldSpec fn v
}

-- | emptySpec without all the constraints
defaultMapSpec :: Ord k => MapSpec fn k v
defaultMapSpec = MapSpec Nothing mempty mempty TrueSpec TrueSpec NoFold

Expand Down Expand Up @@ -80,6 +81,9 @@ instance
(MapSpec mHint' mustKeys' mustVals' size' kvs' foldSpec') = fromGE ErrorSpec $ do
typeSpec
. MapSpec
-- This is min because that allows more compositionality - if a spec specifies a
-- low upper bound because some part of the spec will be slow it doesn't make sense
-- to increase it somewhere else because that part isn't slow.
(unionWithMaybe min mHint mHint')
(mustKeys <> mustKeys')
(nub $ mustVals <> mustVals')
Expand Down

0 comments on commit 71ba341

Please sign in to comment.