Skip to content

Add uniquely named type aliases for each Vector type to Data.Vector.Generic #240

Description

@merijn

This would let people more easily write code dealing with multiple Vector types without needing to do a qualified import from a different module for each type, just to get the type in scope. Some of my code has 7 lines of Vector imports just to bring different types into scope. Having unique alias for each in Data.Vector.Generic would solve that issue

Activity

  1. chessai commented on May 11, 2019

    @chessai
    Member

    I agree that this would be useful. Anyone else's opinions on whether or not they would think this is useful?

    Bikeshedding: What is your opinion on the names? What are others' opinions on the names?

    Once we've sorted that out, I think a PR would be great.

  2. cartazio commented on May 12, 2019

    @cartazio
    Contributor
  3. cartazio commented on May 12, 2019

    @cartazio
    Contributor

    to be clear, i'd rather avoid large bikesheddings,

  4. cartazio commented on May 12, 2019

    @cartazio
    Contributor

    and do the person who posted to this ticket and deleted their comment: i'm the maintainer :P

  5. cartazio commented on May 12, 2019

    @cartazio
    Contributor

    strawman:

    BoxedIVec/BoxedMVec -- Data.Vector/Data.Vector.Mutable
    UnboxedIVec / UnboxedMVec -- Data.Vector.Unboxed
    CStructIVec / CStructMVec -- Data.Vector Storable

    the last one is because the Vector use of storable is really about Pinned arrays (on or off heap) via foreign pointers to interact with Arrays of C compatible struct style data (we could call it )

    an alternative for unboxed could be SOAIVec and SOAMVec, but that just seems terrible, even though Struct of Array IS a correct term of them.

    theres some realted issues of the current punning between the Vector type class and Vector types,which wasn't the case in vector major versions 0.1 and 0.2, but came into play later

  6. ekmett commented on Jun 6, 2019

    @ekmett
    Member

    I'd err on the side of being explicit and recycling existing naming.

    What about just using e.g

        StorableVector / MStorableVector
        BoxedVector / MBoxedVector
        PrimitiveVector / MPrimitiveVector
    

    They are more verbose, yes. But that way there isn't any name mangling.

    The only thing that has to have a "made up" name is BoxedVector as Boxed doesn't show up anywhere else.

  7. cartazio commented on Jun 6, 2019

    @cartazio
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions