-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
Ooooh, I will have a play tomorrow and see if I messed something up. Thanks! |
@@ -0,0 +1,23 @@ | |||
module Data.Inject.Either where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be Data.Inject.Coproduct
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh yes 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this change is required to compile - it collides with the other Data.Inject.Either module in this project.
Are you sure you were building with latest
|
(The error says |
Ack, maybe it was user error on my part then... I did pull master and The other thing I thought of, is this version using instance chains can inject into the left or the right, the original definition is biased to one side, so perhaps I tested with that and it failed. I'll try and reproduce again later today, sorry to waste your time! |
@LiamGoodacre I figured it out. I did |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires a few changes to compile with the 0.12 package-set.
prj = coproduct (const Nothing) prj | ||
|
||
else instance injectReflexive :: Inject f f where | ||
inj = id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id => identity
@@ -0,0 +1,23 @@ | |||
module Data.Inject.Either where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this change is required to compile - it collides with the other Data.Inject.Either module in this project.
prj = either (const Nothing) prj | ||
|
||
else instance injectReflexive :: Inject a a where | ||
inj = id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id => identity
Requested changes are addressed in #11, so you can merge that, then merge this PR later. |
Closing as we will move these type classes and instances to functors/either. |
I think as per #9 we probably want to deprecate this library and put these classes with
Either
/Coproduct
, but just thought I'd try this out.@LiamGoodacre I was a little surprised to find that it didn't raise an error even when these were defined without instance chains until used. I thought purescript/purescript#3129 would have changed that? Maybe I misunderstood.