Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.
This repository was archived by the owner on Feb 8, 2022. It is now read-only.

Array instances #130

Description

@rklaehn

Add instances for arrays.

Arrays are essential in many cases for compact representation, so I think having array instances would be good.

I care most about really basic things like Eq[A] and Order[A], but I guess it would do no harm to just copy everything applicable to algebra from https://github.com/non/spire/blob/master/core/shared/src/main/scala/spire/std/array.scala

Activity

  1. denisrosset commented on Dec 9, 2015

    @denisrosset
    Contributor

    Agree totally.

  2. rklaehn commented on Dec 9, 2015

    @rklaehn
    ContributorAuthor

    Should this use @specialized or not?

  3. denisrosset commented on Dec 10, 2015

    @denisrosset
    Contributor

    Thanks @rklaehn, I guess the issue can be closed!

  4. rklaehn commented on Dec 10, 2015

    @rklaehn
    ContributorAuthor

    Well, it depends. There are a lot of instances that we could provide. I just copied over the essential (for me) ones. But I think we should at least provide Monoid before we close the issue.

  5. johnynek commented on Dec 10, 2015

    @johnynek
    Contributor

    We probably want a few:

    def concatMonoid[T: ClassTag]: Monoid[Array[T]]
    // then the usual vector space style ones, which are probably what people want:
    def extendingPointwiseSemigroup[T: ClassTag: Semigroup]: Semigroup[Array[T]]
    // you can do pretty much everything this way in core except Field, I think.
    // It is a shame we have to write those all out. Maybe macros could help here.
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