Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Add Semigroup and Monoid instances for Eff#32

Merged
garyb merged 1 commit into
purescript-deprecated:masterfrom
i-am-tom:master
Feb 24, 2018
Merged

Add Semigroup and Monoid instances for Eff#32
garyb merged 1 commit into
purescript-deprecated:masterfrom
i-am-tom:master

Conversation

@i-am-tom

Copy link
Copy Markdown

This commit allows Eff values to be combined via the usual Applicative-given instances. Also updated Pulp so it wasn't still looking for a psc executable.

This commit allows `Eff` values to be combined via the usual
`Applicative`-given instances.

@hdgarrood hdgarrood left a comment

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.

There's a proof that these are valid at http://www.haskellforall.com/2014/07/equational-reasoning-at-scale.html#appendix-b

Anyone else want to comment or should we just go ahead and merge?

@hdgarrood

Copy link
Copy Markdown
Contributor

Oh, the monoid dependency could be an issue. eff has always been quite low down in the hierarchy.

@matthewleon

Copy link
Copy Markdown
Contributor

Maybe keep the Semigroup instance here and move the Monoid instance to purescript-monoid, if that works?

@garyb

garyb commented Feb 24, 2018

Copy link
Copy Markdown
Member

Let's do this 👍

@matthewleon I think this way is probably better, as -monoid doesn't depend on -eff either, and it seems to follow the philosophy better to pull in a "pure" type into -eff than vice-versa 😄

@garyb garyb merged commit 44fad68 into purescript-deprecated:master Feb 24, 2018
@chexxor

chexxor commented Feb 25, 2018

Copy link
Copy Markdown

Oh boy, I discovered just now that Eff now has a transitive dependency on ps-control and ps-invariant now, as those are dependencies of ps-monoid: https://github.com/purescript/purescript-monoid/blob/92a0fceefb37fdb17b5d9fb102aa981e6200655b/bower.json

A bit disappointing, but just an observation. It should be fixed in ps-monoid library instead. @i-am-tom Did you have any thoughts on this?

@i-am-tom

Copy link
Copy Markdown
Author

I'm not sure - does this cause any issues? Or is the concern just extra packages to install?

@chexxor

chexxor commented Feb 25, 2018

Copy link
Copy Markdown

@i-am-tom Well, just the extra packages is a bit odd. Take a look at the packages required to do main = log "Hello sailor":

https://github.com/chexxor/documentation/blob/ad508b5f7c49b07542a69b88af36218717ab8e31/guides/Dependency-Management/Git.purs

Gotta pull in purescript-control and those fun things!

Again, not a problem, really, just a bit disappointing that purescript-control needs to be installed to do the Hello World program.

@paldepind

Copy link
Copy Markdown
Contributor

This is really useful. I was just looking for a semigroup instance for Eff. Would love to see this released soon ❤️

@i-am-tom

Copy link
Copy Markdown
Author

@paldepind Already has been! :)

@paldepind

Copy link
Copy Markdown
Contributor

You're right, it does work in code. But isn't it supposed to show up in the docs here?

screenshot_20180328_121752

Or am I missing something?

@i-am-tom

Copy link
Copy Markdown
Author

The docs need updating :( I believe anyone can do it - you just have to clone the package and run pulp publish, iirc?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants