Skip to content

Commit bb1ec48

Browse files
authored
Add clear warnings in Haddocks (#1087)
Add clear warnings for functions which have preconditions for creating valid structures.
1 parent 25036a9 commit bb1ec48

File tree

6 files changed

+141
-38
lines changed

6 files changed

+141
-38
lines changed

Diff for: containers/src/Data/IntMap/Internal.hs

+21-5
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ symDiffTip !t1 !k1 = go
13581358
-- efficiency (with exception of 'union', 'difference' and 'intersection',
13591359
-- where sharing of some nodes is lost with 'mergeWithKey').
13601360
--
1361-
-- Please make sure you know what is going on when using 'mergeWithKey',
1361+
-- __Warning__: Please make sure you know what is going on when using 'mergeWithKey',
13621362
-- otherwise you can be surprised by unexpected code growth or even
13631363
-- corruption of the data structure.
13641364
--
@@ -2616,7 +2616,6 @@ mapKeysWith c f
26162616
-- @'mapKeysMonotonic' f s == 'mapKeys' f s@, but works only when @f@
26172617
-- is strictly monotonic.
26182618
-- That is, for any values @x@ and @y@, if @x@ < @y@ then @f x@ < @f y@.
2619-
-- /The precondition is not checked./
26202619
-- Semi-formally, we have:
26212620
--
26222621
-- > and [x < y ==> f x < f y | x <- ls, y <- ls]
@@ -2626,6 +2625,10 @@ mapKeysWith c f
26262625
-- This means that @f@ maps distinct original keys to distinct resulting keys.
26272626
-- This function has slightly better performance than 'mapKeys'.
26282627
--
2628+
-- __Warning__: This function should be used only if @f@ is monotonically
2629+
-- strictly increasing. This precondition is not checked. Use 'mapKeys' if the
2630+
-- precondition may not hold.
2631+
--
26292632
-- > mapKeysMonotonic (\ k -> k * 2) (fromList [(5,"a"), (3,"b")]) == fromList [(6, "b"), (10, "a")]
26302633

26312634
mapKeysMonotonic :: (Key->Key) -> IntMap a -> IntMap a
@@ -3336,6 +3339,10 @@ fromListWithKey f xs
33363339
-- | \(O(n)\). Build a map from a list of key\/value pairs where
33373340
-- the keys are in ascending order.
33383341
--
3342+
-- __Warning__: This function should be used only if the keys are in
3343+
-- non-decreasing order. This precondition is not checked. Use 'fromList' if the
3344+
-- precondition may not hold.
3345+
--
33393346
-- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
33403347
-- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
33413348

@@ -3345,7 +3352,10 @@ fromAscList = fromMonoListWithKey Nondistinct (\_ x _ -> x)
33453352

33463353
-- | \(O(n)\). Build a map from a list of key\/value pairs where
33473354
-- the keys are in ascending order, with a combining function on equal keys.
3348-
-- /The precondition (input list is ascending) is not checked./
3355+
--
3356+
-- __Warning__: This function should be used only if the keys are in
3357+
-- non-decreasing order. This precondition is not checked. Use 'fromListWith' if
3358+
-- the precondition may not hold.
33493359
--
33503360
-- > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
33513361
--
@@ -3357,7 +3367,10 @@ fromAscListWith f = fromMonoListWithKey Nondistinct (\_ x y -> f x y)
33573367

33583368
-- | \(O(n)\). Build a map from a list of key\/value pairs where
33593369
-- the keys are in ascending order, with a combining function on equal keys.
3360-
-- /The precondition (input list is ascending) is not checked./
3370+
--
3371+
-- __Warning__: This function should be used only if the keys are in
3372+
-- non-decreasing order. This precondition is not checked. Use 'fromListWithKey'
3373+
-- if the precondition may not hold.
33613374
--
33623375
-- > let f key new_value old_value = (show key) ++ ":" ++ new_value ++ "|" ++ old_value
33633376
-- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "5:b|a")]
@@ -3370,7 +3383,10 @@ fromAscListWithKey f = fromMonoListWithKey Nondistinct f
33703383

33713384
-- | \(O(n)\). Build a map from a list of key\/value pairs where
33723385
-- the keys are in ascending order and all distinct.
3373-
-- /The precondition (input list is strictly ascending) is not checked./
3386+
--
3387+
-- __Warning__: This function should be used only if the keys are in
3388+
-- strictly increasing order. This precondition is not checked. Use 'fromList'
3389+
-- if the precondition may not hold.
33743390
--
33753391
-- > fromDistinctAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
33763392

Diff for: containers/src/Data/IntMap/Strict/Internal.hs

+17-4
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ intersectionWithKey f m1 m2
709709
-- efficiency (with exception of 'union', 'difference' and 'intersection',
710710
-- where sharing of some nodes is lost with 'mergeWithKey').
711711
--
712-
-- Please make sure you know what is going on when using 'mergeWithKey',
712+
-- __Warning__: Please make sure you know what is going on when using 'mergeWithKey',
713713
-- otherwise you can be surprised by unexpected code growth or even
714714
-- corruption of the data structure.
715715
--
@@ -1132,6 +1132,10 @@ fromListWithKey f xs
11321132
-- | \(O(n)\). Build a map from a list of key\/value pairs where
11331133
-- the keys are in ascending order.
11341134
--
1135+
-- __Warning__: This function should be used only if the keys are in
1136+
-- non-decreasing order. This precondition is not checked. Use 'fromList' if the
1137+
-- precondition may not hold.
1138+
--
11351139
-- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
11361140
-- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
11371141

@@ -1141,7 +1145,10 @@ fromAscList = fromMonoListWithKey Nondistinct (\_ x _ -> x)
11411145

11421146
-- | \(O(n)\). Build a map from a list of key\/value pairs where
11431147
-- the keys are in ascending order, with a combining function on equal keys.
1144-
-- /The precondition (input list is ascending) is not checked./
1148+
--
1149+
-- __Warning__: This function should be used only if the keys are in
1150+
-- non-decreasing order. This precondition is not checked. Use 'fromListWith' if
1151+
-- the precondition may not hold.
11451152
--
11461153
-- > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
11471154
--
@@ -1153,7 +1160,10 @@ fromAscListWith f = fromMonoListWithKey Nondistinct (\_ x y -> f x y)
11531160

11541161
-- | \(O(n)\). Build a map from a list of key\/value pairs where
11551162
-- the keys are in ascending order, with a combining function on equal keys.
1156-
-- /The precondition (input list is ascending) is not checked./
1163+
--
1164+
-- __Warning__: This function should be used only if the keys are in
1165+
-- non-decreasing order. This precondition is not checked. Use 'fromListWithKey'
1166+
-- if the precondition may not hold.
11571167
--
11581168
-- > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
11591169
--
@@ -1165,7 +1175,10 @@ fromAscListWithKey f = fromMonoListWithKey Nondistinct f
11651175

11661176
-- | \(O(n)\). Build a map from a list of key\/value pairs where
11671177
-- the keys are in ascending order and all distinct.
1168-
-- /The precondition (input list is strictly ascending) is not checked./
1178+
--
1179+
-- __Warning__: This function should be used only if the keys are in
1180+
-- strictly increasing order. This precondition is not checked. Use 'fromList'
1181+
-- if the precondition may not hold.
11691182
--
11701183
-- > fromDistinctAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
11711184

Diff for: containers/src/Data/IntSet/Internal.hs

+12-3
Original file line numberDiff line numberDiff line change
@@ -1150,13 +1150,16 @@ map f = fromList . List.map f . toList
11501150
-- | \(O(n)\). The
11511151
--
11521152
-- @'mapMonotonic' f s == 'map' f s@, but works only when @f@ is strictly increasing.
1153-
-- /The precondition is not checked./
11541153
-- Semi-formally, we have:
11551154
--
11561155
-- > and [x < y ==> f x < f y | x <- ls, y <- ls]
11571156
-- > ==> mapMonotonic f s == map f s
11581157
-- > where ls = toList s
11591158
--
1159+
-- __Warning__: This function should be used only if @f@ is monotonically
1160+
-- strictly increasing. This precondition is not checked. Use 'map' if the
1161+
-- precondition may not hold.
1162+
--
11601163
-- @since 0.6.3.1
11611164

11621165
-- Note that for now the test is insufficient to support any fancier implementation.
@@ -1387,13 +1390,19 @@ fromRange (lx,rx)
13871390
{-# INLINE shr1 #-}
13881391

13891392
-- | \(O(n)\). Build a set from an ascending list of elements.
1390-
-- /The precondition (input list is ascending) is not checked./
1393+
--
1394+
-- __Warning__: This function should be used only if the elements are in
1395+
-- non-decreasing order. This precondition is not checked. Use 'fromList' if the
1396+
-- precondition may not hold.
13911397
fromAscList :: [Key] -> IntSet
13921398
fromAscList = fromMonoList
13931399
{-# NOINLINE fromAscList #-}
13941400

13951401
-- | \(O(n)\). Build a set from an ascending list of distinct elements.
1396-
-- /The precondition (input list is strictly ascending) is not checked./
1402+
--
1403+
-- __Warning__: This function should be used only if the elements are in
1404+
-- strictly increasing order. This precondition is not checked. Use 'fromList'
1405+
-- if the precondition may not hold.
13971406
fromDistinctAscList :: [Key] -> IntSet
13981407
fromDistinctAscList = fromAscList
13991408
{-# INLINE fromDistinctAscList #-}

Diff for: containers/src/Data/Map/Internal.hs

+37-10
Original file line numberDiff line numberDiff line change
@@ -2784,7 +2784,7 @@ mergeA
27842784

27852785
-- | \(O(n+m)\). An unsafe general combining function.
27862786
--
2787-
-- WARNING: This function can produce corrupt maps and its results
2787+
-- __Warning__: This function can produce corrupt maps and its results
27882788
-- may depend on the internal structures of its inputs. Users should
27892789
-- prefer 'merge' or 'mergeA'.
27902790
--
@@ -3293,7 +3293,6 @@ mapKeysWith c f m =
32933293
-- @'mapKeysMonotonic' f s == 'mapKeys' f s@, but works only when @f@
32943294
-- is strictly monotonic.
32953295
-- That is, for any values @x@ and @y@, if @x@ < @y@ then @f x@ < @f y@.
3296-
-- /The precondition is not checked./
32973296
-- Semi-formally, we have:
32983297
--
32993298
-- > and [x < y ==> f x < f y | x <- ls, y <- ls]
@@ -3303,6 +3302,10 @@ mapKeysWith c f m =
33033302
-- This means that @f@ maps distinct original keys to distinct resulting keys.
33043303
-- This function has better performance than 'mapKeys'.
33053304
--
3305+
-- __Warning__: This function should be used only if @f@ is monotonically
3306+
-- strictly increasing. This precondition is not checked. Use 'mapKeys' if the
3307+
-- precondition may not hold.
3308+
--
33063309
-- > mapKeysMonotonic (\ k -> k * 2) (fromList [(5,"a"), (3,"b")]) == fromList [(6, "b"), (10, "a")]
33073310
-- > valid (mapKeysMonotonic (\ k -> k * 2) (fromList [(5,"a"), (3,"b")])) == True
33083311
-- > valid (mapKeysMonotonic (\ _ -> 1) (fromList [(5,"a"), (3,"b")])) == False
@@ -3663,7 +3666,10 @@ foldlFB = foldlWithKey
36633666
fromAscListWith f xs == fromListWith f xs
36643667
--------------------------------------------------------------------}
36653668
-- | \(O(n)\). Build a map from an ascending list in linear time.
3666-
-- /The precondition (input list is ascending) is not checked./
3669+
--
3670+
-- __Warning__: This function should be used only if the keys are in
3671+
-- non-decreasing order. This precondition is not checked. Use 'fromList' if the
3672+
-- precondition may not hold.
36673673
--
36683674
-- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
36693675
-- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
@@ -3675,7 +3681,10 @@ fromAscList xs = fromAscListWithKey (\_ x _ -> x) xs
36753681
{-# INLINE fromAscList #-} -- INLINE for fusion
36763682

36773683
-- | \(O(n)\). Build a map from a descending list in linear time.
3678-
-- /The precondition (input list is descending) is not checked./
3684+
--
3685+
-- __Warning__: This function should be used only if the keys are in
3686+
-- non-increasing order. This precondition is not checked. Use 'fromList' if the
3687+
-- precondition may not hold.
36793688
--
36803689
-- > fromDescList [(5,"a"), (3,"b")] == fromList [(3, "b"), (5, "a")]
36813690
-- > fromDescList [(5,"a"), (5,"b"), (3,"b")] == fromList [(3, "b"), (5, "b")]
@@ -3689,7 +3698,10 @@ fromDescList xs = fromDescListWithKey (\_ x _ -> x) xs
36893698
{-# INLINE fromDescList #-} -- INLINE for fusion
36903699

36913700
-- | \(O(n)\). Build a map from an ascending list in linear time with a combining function for equal keys.
3692-
-- /The precondition (input list is ascending) is not checked./
3701+
--
3702+
-- __Warning__: This function should be used only if the keys are in
3703+
-- non-decreasing order. This precondition is not checked. Use 'fromListWith' if
3704+
-- the precondition may not hold.
36933705
--
36943706
-- > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
36953707
-- > valid (fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")]) == True
@@ -3701,7 +3713,10 @@ fromAscListWith f xs
37013713
{-# INLINE fromAscListWith #-} -- INLINE for fusion
37023714

37033715
-- | \(O(n)\). Build a map from a descending list in linear time with a combining function for equal keys.
3704-
-- /The precondition (input list is descending) is not checked./
3716+
--
3717+
-- __Warning__: This function should be used only if the keys are in
3718+
-- non-increasing order. This precondition is not checked. Use 'fromListWith' if
3719+
-- the precondition may not hold.
37053720
--
37063721
-- > fromDescListWith (++) [(5,"a"), (5,"b"), (3,"b")] == fromList [(3, "b"), (5, "ba")]
37073722
-- > valid (fromDescListWith (++) [(5,"a"), (5,"b"), (3,"b")]) == True
@@ -3718,7 +3733,10 @@ fromDescListWith f xs
37183733

37193734
-- | \(O(n)\). Build a map from an ascending list in linear time with a
37203735
-- combining function for equal keys.
3721-
-- /The precondition (input list is ascending) is not checked./
3736+
--
3737+
-- __Warning__: This function should be used only if the keys are in
3738+
-- non-decreasing order. This precondition is not checked. Use 'fromListWithKey'
3739+
-- if the precondition may not hold.
37223740
--
37233741
-- > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2
37243742
-- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")] == fromList [(3, "b"), (5, "5:b5:ba")]
@@ -3740,7 +3758,10 @@ fromAscListWithKey f xs = ascLinkAll (Foldable.foldl' next Nada xs)
37403758

37413759
-- | \(O(n)\). Build a map from a descending list in linear time with a
37423760
-- combining function for equal keys.
3743-
-- /The precondition (input list is descending) is not checked./
3761+
--
3762+
-- __Warning__: This function should be used only if the keys are in
3763+
-- non-increasing order. This precondition is not checked. Use 'fromListWithKey'
3764+
-- if the precondition may not hold.
37443765
--
37453766
-- > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2
37463767
-- > fromDescListWithKey f [(5,"a"), (5,"b"), (5,"b"), (3,"b")] == fromList [(3, "b"), (5, "5:b5:ba")]
@@ -3762,7 +3783,10 @@ fromDescListWithKey f xs = descLinkAll (Foldable.foldl' next Nada xs)
37623783

37633784

37643785
-- | \(O(n)\). Build a map from an ascending list of distinct elements in linear time.
3765-
-- /The precondition is not checked./
3786+
--
3787+
-- __Warning__: This function should be used only if the keys are in
3788+
-- strictly increasing order. This precondition is not checked. Use 'fromList'
3789+
-- if the precondition may not hold.
37663790
--
37673791
-- > fromDistinctAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
37683792
-- > valid (fromDistinctAscList [(3,"b"), (5,"a")]) == True
@@ -3789,7 +3813,10 @@ ascLinkAll stk = foldl'Stack (\r kx x l -> link kx x l r) Tip stk
37893813
{-# INLINABLE ascLinkAll #-}
37903814

37913815
-- | \(O(n)\). Build a map from a descending list of distinct elements in linear time.
3792-
-- /The precondition is not checked./
3816+
--
3817+
-- __Warning__: This function should be used only if the keys are in
3818+
-- strictly decreasing order. This precondition is not checked. Use 'fromList'
3819+
-- if the precondition may not hold.
37933820
--
37943821
-- > fromDistinctDescList [(5,"a"), (3,"b")] == fromList [(3, "b"), (5, "a")]
37953822
-- > valid (fromDistinctDescList [(5,"a"), (3,"b")]) == True

Diff for: containers/src/Data/Map/Strict/Internal.hs

+33-9
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ forceMaybe m@(Just !_) = m
11991199

12001200
-- | \(O(n+m)\). An unsafe universal combining function.
12011201
--
1202-
-- WARNING: This function can produce corrupt maps and its results
1202+
-- __Warning__: This function can produce corrupt maps and its results
12031203
-- may depend on the internal structures of its inputs. Users should
12041204
-- prefer 'Data.Map.Merge.Strict.merge' or
12051205
-- 'Data.Map.Merge.Strict.mergeA'.
@@ -1570,7 +1570,10 @@ fromListWithKey f xs =
15701570
--------------------------------------------------------------------}
15711571

15721572
-- | \(O(n)\). Build a map from an ascending list in linear time.
1573-
-- /The precondition (input list is ascending) is not checked./
1573+
--
1574+
-- __Warning__: This function should be used only if the keys are in
1575+
-- non-decreasing order. This precondition is not checked. Use 'fromList' if the
1576+
-- precondition may not hold.
15741577
--
15751578
-- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
15761579
-- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
@@ -1582,7 +1585,10 @@ fromAscList xs
15821585
{-# INLINE fromAscList #-} -- INLINE for fusion
15831586

15841587
-- | \(O(n)\). Build a map from a descending list in linear time.
1585-
-- /The precondition (input list is descending) is not checked./
1588+
--
1589+
-- __Warning__: This function should be used only if the keys are in
1590+
-- non-increasing order. This precondition is not checked. Use 'fromList' if the
1591+
-- precondition may not hold.
15861592
--
15871593
-- > fromDescList [(5,"a"), (3,"b")] == fromList [(3, "b"), (5, "a")]
15881594
-- > fromDescList [(5,"a"), (5,"b"), (3,"a")] == fromList [(3, "b"), (5, "b")]
@@ -1594,7 +1600,10 @@ fromDescList xs
15941600
{-# INLINE fromDescList #-} -- INLINE for fusion
15951601

15961602
-- | \(O(n)\). Build a map from an ascending list in linear time with a combining function for equal keys.
1597-
-- /The precondition (input list is ascending) is not checked./
1603+
--
1604+
-- __Warning__: This function should be used only if the keys are in
1605+
-- non-decreasing order. This precondition is not checked. Use 'fromListWith' if
1606+
-- the precondition may not hold.
15981607
--
15991608
-- > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
16001609
-- > valid (fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")]) == True
@@ -1608,7 +1617,10 @@ fromAscListWith f xs
16081617
{-# INLINE fromAscListWith #-} -- INLINE for fusion
16091618

16101619
-- | \(O(n)\). Build a map from a descending list in linear time with a combining function for equal keys.
1611-
-- /The precondition (input list is descending) is not checked./
1620+
--
1621+
-- __Warning__: This function should be used only if the keys are in
1622+
-- non-increasing order. This precondition is not checked. Use 'fromListWith' if
1623+
-- the precondition may not hold.
16121624
--
16131625
-- > fromDescListWith (++) [(5,"a"), (5,"b"), (3,"b")] == fromList [(3, "b"), (5, "ba")]
16141626
-- > valid (fromDescListWith (++) [(5,"a"), (5,"b"), (3,"b")]) == True
@@ -1623,7 +1635,10 @@ fromDescListWith f xs
16231635

16241636
-- | \(O(n)\). Build a map from an ascending list in linear time with a
16251637
-- combining function for equal keys.
1626-
-- /The precondition (input list is ascending) is not checked./
1638+
--
1639+
-- __Warning__: This function should be used only if the keys are in
1640+
-- non-decreasing order. This precondition is not checked. Use 'fromListWithKey'
1641+
-- if the precondition may not hold.
16271642
--
16281643
-- > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2
16291644
-- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")] == fromList [(3, "b"), (5, "5:b5:ba")]
@@ -1646,7 +1661,10 @@ fromAscListWithKey f xs = ascLinkAll (Foldable.foldl' next Nada xs)
16461661

16471662
-- | \(O(n)\). Build a map from a descending list in linear time with a
16481663
-- combining function for equal keys.
1649-
-- /The precondition (input list is descending) is not checked./
1664+
--
1665+
-- __Warning__: This function should be used only if the keys are in
1666+
-- non-increasing order. This precondition is not checked. Use 'fromListWithKey'
1667+
-- if the precondition may not hold.
16501668
--
16511669
-- > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2
16521670
-- > fromDescListWithKey f [(5,"a"), (5,"b"), (5,"b"), (3,"b")] == fromList [(3, "b"), (5, "5:b5:ba")]
@@ -1668,7 +1686,10 @@ fromDescListWithKey f xs = descLinkAll (Foldable.foldl' next Nada xs)
16681686
{-# INLINE fromDescListWithKey #-} -- INLINE for fusion
16691687

16701688
-- | \(O(n)\). Build a map from an ascending list of distinct elements in linear time.
1671-
-- /The precondition is not checked./
1689+
--
1690+
-- __Warning__: This function should be used only if the keys are in
1691+
-- strictly increasing order. This precondition is not checked. Use 'fromList'
1692+
-- if the precondition may not hold.
16721693
--
16731694
-- > fromDistinctAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
16741695
-- > valid (fromDistinctAscList [(3,"b"), (5,"a")]) == True
@@ -1684,7 +1705,10 @@ fromDistinctAscList xs = ascLinkAll (Foldable.foldl' next Nada xs)
16841705
{-# INLINE fromDistinctAscList #-} -- INLINE for fusion
16851706

16861707
-- | \(O(n)\). Build a map from a descending list of distinct elements in linear time.
1687-
-- /The precondition is not checked./
1708+
--
1709+
-- __Warning__: This function should be used only if the keys are in
1710+
-- strictly decreasing order. This precondition is not checked. Use 'fromList'
1711+
-- if the precondition may not hold.
16881712
--
16891713
-- > fromDistinctDescList [(5,"a"), (3,"b")] == fromList [(3, "b"), (5, "a")]
16901714
-- > valid (fromDistinctDescList [(5,"a"), (3,"b")]) == True

0 commit comments

Comments
 (0)