@@ -13,7 +13,7 @@ import Data.Map.Internal.Debug (showTree, showTreeWith, balanced)
13
13
import Control.Applicative (Const (Const , getConst ), pure , (<$>) , (<*>) )
14
14
import Control.Monad.Trans.State.Strict
15
15
import Control.Monad.Trans.Class
16
- import Control.Monad (liftM4 )
16
+ import Control.Monad (liftM4 , (<=<) )
17
17
import Data.Functor.Identity (Identity (Identity , runIdentity ))
18
18
import Data.Monoid
19
19
import Data.Maybe hiding (mapMaybe )
@@ -180,6 +180,7 @@ main = defaultMain
180
180
, testProperty " intersectionWithKey" prop_intersectionWithKey
181
181
, testProperty " intersectionWithKeyModel" prop_intersectionWithKeyModel
182
182
, testProperty " disjoint" prop_disjoint
183
+ , testProperty " compose" prop_compose
183
184
, testProperty " differenceMerge" prop_differenceMerge
184
185
, testProperty " unionWithKeyMerge" prop_unionWithKeyMerge
185
186
, testProperty " mergeWithKey model" prop_mergeWithKeyModel
@@ -1160,6 +1161,9 @@ prop_intersectionWithKeyModel xs ys
1160
1161
prop_disjoint :: UMap -> UMap -> Property
1161
1162
prop_disjoint m1 m2 = disjoint m1 m2 === null (intersection m1 m2)
1162
1163
1164
+ prop_compose :: IMap -> IMap -> Int -> Property
1165
+ prop_compose bc ab k = (compose bc ab !? k) === ((bc !? ) <=< (ab !? )) k
1166
+
1163
1167
prop_mergeWithKeyModel :: [(Int ,Int )] -> [(Int ,Int )] -> Bool
1164
1168
prop_mergeWithKeyModel xs ys
1165
1169
= and [ testMergeWithKey f keep_x keep_y
0 commit comments