Skip to content

Make V Monoid #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2017
Merged

Make V Monoid #12

merged 2 commits into from
Jun 3, 2017

Conversation

safareli
Copy link
Contributor

@safareli safareli commented May 3, 2017

No description provided.

@@ -70,3 +71,9 @@ instance applyV :: (Semigroup err) => Apply (V err) where

instance applicativeV :: (Semigroup err) => Applicative (V err) where
pure = Valid

instance semigroupV :: (Semigroup err, Semigroup a) => Semigroup (V err a) where
append x y = append <$> x <*> y
Copy link
Contributor

Choose a reason for hiding this comment

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

Can use lift2 here.

Choose a reason for hiding this comment

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

Out of interest: is lift2 faster?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess not, but difference should be really small right?
Also javascript runtime could optimise lift2 if it's called too often.

@@ -77,6 +78,12 @@ instance applyV :: (Semiring err) => Apply (V err) where
instance applicativeV :: (Semiring err) => Applicative (V err) where
pure = Valid

instance semigroupV :: (Semiring err, Semigroup a) => Semigroup (V err a) where
append x y = append <$> x <*> y
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

@safareli
Copy link
Contributor Author

safareli commented Jun 2, 2017

@paf31 @kritzcreek ping

@paf31 paf31 merged commit f934666 into purescript:master Jun 3, 2017
@paf31
Copy link
Contributor

paf31 commented Jun 3, 2017

Thanks!

@safareli safareli deleted the monoid branch June 4, 2017 11:19
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.

3 participants