Skip to content

Add Consumable and Dupable instances to V#324

Merged
Divesh-Otwani merged 1 commit intomasterfrom
consumable-dupable-v
Apr 13, 2021
Merged

Add Consumable and Dupable instances to V#324
Divesh-Otwani merged 1 commit intomasterfrom
consumable-dupable-v

Conversation

@aspiwack
Copy link
Copy Markdown
Member

@aspiwack aspiwack commented Apr 9, 2021

Closes #310 .

@aspiwack aspiwack requested a review from Divesh-Otwani April 9, 2021 15:56
Copy link
Copy Markdown
Contributor

@Divesh-Otwani Divesh-Otwani left a comment

Choose a reason for hiding this comment

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

Looks OK.

Comment on lines +149 to +151
-- XXX: The Consumable and Dupable instances for V will be easier to define (in
-- fact direct, we may consider adding a deriving-via combinator) when we have a
-- traversable-by-a-data-applicative class see #190.
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.

This is a confusing comment but I'm going to assume there's a clear explanation of what it means in #190.

Comment on lines +156 to +159
instance (KnownNat n, Dupable a) => Dupable (V n a) where
dupV (V xs) =
V . Unsafe.toLinear (Vector.fromListN (theLength @n)) Data.<$>
dupV (Unsafe.toLinear Vector.toList xs)
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.

I don't know why you would need this but OK.

@Divesh-Otwani Divesh-Otwani merged commit 28fcd2c into master Apr 13, 2021
@Divesh-Otwani Divesh-Otwani deleted the consumable-dupable-v branch April 13, 2021 00:16
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.

Consumable/Dupable (V n a)

2 participants