From 9ce3d275fd7344de708810e76af0903fd883dd6b Mon Sep 17 00:00:00 2001 From: Alexey Khudyakov Date: Wed, 30 Oct 2024 20:24:40 +0300 Subject: [PATCH] Drop "possibly" from force's haddocks force indeed copies unconditionally. Even in case like: > force (generate n fun) In principle GHC could be able to elide copying using rewrite rules related to clone/New in practice it doesn't. So it's better to remove possibly since it will only confuse reader. Fixes #511 --- vector/src/Data/Vector.hs | 2 +- vector/src/Data/Vector/Generic.hs | 2 +- vector/src/Data/Vector/Primitive.hs | 2 +- vector/src/Data/Vector/Storable.hs | 2 +- vector/src/Data/Vector/Strict.hs | 2 +- vector/src/Data/Vector/Unboxed.hs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vector/src/Data/Vector.hs b/vector/src/Data/Vector.hs index 5296da9e..305397c4 100644 --- a/vector/src/Data/Vector.hs +++ b/vector/src/Data/Vector.hs @@ -892,7 +892,7 @@ createT p = G.createT p -- ------------------------ -- | /O(n)/ Yield the argument, but force it not to retain any extra memory, --- possibly by copying it. +-- by copying it. -- -- This is especially useful when dealing with slices. For example: -- diff --git a/vector/src/Data/Vector/Generic.hs b/vector/src/Data/Vector/Generic.hs index ec43034c..35acd0fb 100644 --- a/vector/src/Data/Vector/Generic.hs +++ b/vector/src/Data/Vector/Generic.hs @@ -805,7 +805,7 @@ createT p = runST (p >>= T.mapM unsafeFreeze) -- ------------------------ -- | /O(n)/ Yield the argument, but force it not to retain any extra memory, --- possibly by copying it. +-- by copying it. -- -- This is especially useful when dealing with slices. For example: -- diff --git a/vector/src/Data/Vector/Primitive.hs b/vector/src/Data/Vector/Primitive.hs index b6280432..13e677d5 100644 --- a/vector/src/Data/Vector/Primitive.hs +++ b/vector/src/Data/Vector/Primitive.hs @@ -731,7 +731,7 @@ createT p = G.createT p -- ------------------------ -- | /O(n)/ Yield the argument, but force it not to retain any extra memory, --- possibly by copying it. +-- by copying it. -- -- This is especially useful when dealing with slices. For example: -- diff --git a/vector/src/Data/Vector/Storable.hs b/vector/src/Data/Vector/Storable.hs index edc608c8..e37596e3 100644 --- a/vector/src/Data/Vector/Storable.hs +++ b/vector/src/Data/Vector/Storable.hs @@ -742,7 +742,7 @@ createT p = G.createT p -- ------------------------ -- | /O(n)/ Yield the argument, but force it not to retain any extra memory, --- possibly by copying it. +-- by copying it. -- -- This is especially useful when dealing with slices. For example: -- diff --git a/vector/src/Data/Vector/Strict.hs b/vector/src/Data/Vector/Strict.hs index aee30d4e..bcda621d 100644 --- a/vector/src/Data/Vector/Strict.hs +++ b/vector/src/Data/Vector/Strict.hs @@ -930,7 +930,7 @@ createT p = G.createT p -- ------------------------ -- | /O(n)/ Yield the argument, but force it not to retain any extra memory, --- possibly by copying it. +-- by copying it. -- -- This is especially useful when dealing with slices. For example: -- diff --git a/vector/src/Data/Vector/Unboxed.hs b/vector/src/Data/Vector/Unboxed.hs index 3b57cbd4..feaca0a9 100644 --- a/vector/src/Data/Vector/Unboxed.hs +++ b/vector/src/Data/Vector/Unboxed.hs @@ -705,7 +705,7 @@ createT p = G.createT p -- ------------------------ -- | /O(n)/ Yield the argument, but force it not to retain any extra memory, --- possibly by copying it. +-- by copying it. -- -- This is especially useful when dealing with slices. For example: --