Skip to content

Add MINIMAL pragma to Vector & MVector type classes#289

Merged
lehins merged 4 commits into
haskell:masterfrom
Shimuuar:kh/minimal
Jun 8, 2020
Merged

Add MINIMAL pragma to Vector & MVector type classes#289
lehins merged 4 commits into
haskell:masterfrom
Shimuuar:kh/minimal

Conversation

@Shimuuar

@Shimuuar Shimuuar commented Feb 1, 2020

Copy link
Copy Markdown
Contributor

At the moment only checked that MINIMAL is indeed minimal and no method is ⊥ by visual inspection

Fixes #11

@Shimuuar Shimuuar force-pushed the kh/minimal branch 2 times, most recently from dc5f339 to 9b65b8e Compare February 2, 2020 14:52
@Shimuuar Shimuuar marked this pull request as ready for review February 2, 2020 14:54
@Shimuuar

Shimuuar commented Feb 2, 2020

Copy link
Copy Markdown
Contributor Author

Yes, list is indeed minimal. I also thrown in fix for #213

@lehins lehins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few suggestion on haddock, otherwise looks great

Comment thread Data/Vector/Primitive/Mutable.hs Outdated
Comment thread Data/Vector/Storable/Mutable.hs Outdated
Comment thread Data/Vector/Unboxed/Mutable.hs Outdated
Comment thread Data/Vector/Mutable.hs Outdated
Comment on lines +284 to +289
-- | Create a mutable vector of the given length. The vector content
-- should be presumed uninitialized. However exact semantics depends
-- on vector implementation. For example unboxed and storable
-- vectors will create vector filled with whatever underlying memory
-- buffer happens to contain, while boxed vector initializes every
-- element to @error "..."@.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- | Create a mutable vector of the given length. The vector content
-- should be presumed uninitialized. However exact semantics depends
-- on vector implementation. For example unboxed and storable
-- vectors will create vector filled with whatever underlying memory
-- buffer happens to contain, while boxed vector initializes every
-- element to @error "..."@.
-- | Create a mutable vector of the given length. Boxed vector is
-- initialized with every element set to @error "..."@.
--
-- @since 0.5

Comment thread Data/Vector/Generic/Mutable.hs Outdated
@Bodigrim

Bodigrim commented Jun 7, 2020

Copy link
Copy Markdown
Contributor

I'd probably say that elements of boxed vectors are initialized with bottoms, but do not overspecify whether it is error or undefined or another diverging computation.

@Shimuuar

Shimuuar commented Jun 7, 2020

Copy link
Copy Markdown
Contributor Author

@lehins Thanks for the suggestion. They definitely improved haddocks. And thanks for finding out those @since pragmas

@Bodigrim Yeah, good idea. I also specified that it's exception throwing bottom.

@lehins lehins merged commit f606daa into haskell:master Jun 8, 2020
@Shimuuar Shimuuar deleted the kh/minimal branch June 19, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Minimal annotations to Vector typeclasses

3 participants