Skip to content
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 Star a Monoid #40

Closed
evilsoft opened this issue Jan 28, 2017 · 1 comment
Closed

Make Star a Monoid #40

evilsoft opened this issue Jan 28, 2017 · 1 comment
Assignees

Comments

@evilsoft
Copy link
Owner

Star is good, but it could be great

So I punted on making Star a Monoid and I regret that now after using it a bit. I had an idea of doing something like Writer and parameterizing to a specific Monad. So to make one, you do something like:

const MaybeStar  = Star(Maybe)

// MaybeStar(Maybe.of) ??
MaybeStar.empty()

// and of course `concat` will remain basically just flatMapping for left to right composition.

Then we could use mconcat to build a composition:

mconcat(MaybeStar, [ path([ 'a', 'b' ]), safeLift(not(isNull), add(10) ])
@evilsoft evilsoft added this to the v0.3.0 milestone Jan 28, 2017
@evilsoft evilsoft self-assigned this Feb 10, 2017
@evilsoft evilsoft removed this from the v0.3.0 milestone Feb 19, 2017
@evilsoft
Copy link
Owner Author

hmmm, I do not know about this anymore.
do not think it is a good idea as I implement.
May wait for the community to request it, if it is desired.

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

No branches or pull requests

1 participant