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

Make V Monoid #12

Merged
merged 2 commits into from Jun 3, 2017

Conversation

Projects
None yet
3 participants
@safareli
Copy link
Contributor

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

This comment has been minimized.

@paf31

paf31 May 4, 2017

Member

Can use lift2 here.

This comment has been minimized.

@Profpatsch

Profpatsch May 4, 2017

Out of interest: is lift2 faster?

This comment has been minimized.

@safareli

safareli May 4, 2017

Contributor

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

This comment has been minimized.

@paf31

paf31 May 4, 2017

Member

Same

@safareli safareli force-pushed the safareli:monoid branch from 0f43bb6 to 788634d May 4, 2017

@safareli

This comment has been minimized.

Copy link
Contributor

safareli commented Jun 2, 2017

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@paf31

This comment has been minimized.

Copy link
Member

paf31 commented Jun 3, 2017

Thanks!

@safareli safareli deleted the safareli:monoid branch Jun 4, 2017

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