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

Add more syntax #1398

Merged
merged 4 commits into from
Oct 18, 2016
Merged

Add more syntax #1398

merged 4 commits into from
Oct 18, 2016

Conversation

Fristi
Copy link
Contributor

@Fristi Fristi commented Sep 30, 2016

@non As we talked about at Lamba.world :-)

  • Compose syntax
  • Monoid.combineAll which I would like syntax for, is the same thing as Foldable.foldor Foldable.combineAll which already comes in from Foldable.Ops right?

@jvican
Copy link

jvican commented Sep 30, 2016

Same here @adelbertc | @non, labelling this as hackathon would be cool!

@Fristi
Copy link
Contributor Author

Fristi commented Oct 1, 2016

Compiling took long time at the conference and drained my apple battery. Therefore I committed some stuff so Travis could do the heavy lifting. Compiled/tested it locally now, it should work and in my opinion a squash merge is fine :-)

@codecov-io
Copy link

codecov-io commented Oct 1, 2016

Current coverage is 91.74% (diff: 100%)

Merging #1398 into master will increase coverage by 0.05%

@@             master      #1398   diff @@
==========================================
  Files           240        240          
  Lines          3610       3608     -2   
  Methods        3546       3537     -9   
  Messages          0          0          
  Branches         63         70     +7   
==========================================
  Hits           3310       3310          
+ Misses          300        298     -2   
  Partials          0          0          

Powered by Codecov. Last update a392654...13209e7

@@ -7,8 +7,11 @@ import simulacrum.typeclass
* Must obey the laws defined in cats.laws.ComposeLaws.
*/
@typeclass trait Compose[F[_, _]] { self =>

@simulacrum.op(":<<", alias = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like the asymmetry here. If we have the :<< The other should be >>:.

Copy link
Contributor Author

@Fristi Fristi Oct 14, 2016

Choose a reason for hiding this comment

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

I also dislike it, but I am getting this compile error when introducing >>:, guess it's right associative, even when you put the : on the right.

[error] /Users/mark/Projects/cats/tests/src/test/scala/cats/tests/SyntaxTests.scala:55: type mismatch;
[error]  found   : x$1.type (with underlying type F[B,C])
[error]  required: F[D,?]
[error]     val a = x >>: y >>: z
[error]

@johnynek
Copy link
Contributor

Why doesn't <<< work again?
On Fri, Oct 14, 2016 at 05:39 Mark de Jong notifications@github.com wrote:

@Fristi commented on this pull request.

In core/src/main/scala/cats/arrow/Compose.scala
#1398:

@@ -7,8 +7,11 @@ import simulacrum.typeclass

  • Must obey the laws defined in cats.laws.ComposeLaws.
    */
    @typeclass trait Compose[F[_, _]] { self =>
    +
    • @simulacrum.op(":<<", alias = true)

I also dislike it, but I am getting this compile error when introducing

:, guess it's right associative, even when you put the : on the right.

[error] /Users/mark/Projects/cats/tests/src/test/scala/cats/tests/SyntaxTests.scala:55: type mismatch;
[error] found : x$1.type (with underlying type F[B,C])
[error] required: F[D,?]
[error] val a = x >>: y >>: z
[error]


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#1398, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEJdoc_UeTAROFTCU1clZ9Wx29ykuXtks5qz6IpgaJpZM4KLQ1V
.

@Fristi
Copy link
Contributor Author

Fristi commented Oct 18, 2016

@johnynek It works! I thought it wouldn't due operator associativity.

Good to squash merge now I think :-)

@kailuowang
Copy link
Contributor

👍

1 similar comment
@johnynek
Copy link
Contributor

👍

@johnynek johnynek merged commit 3b0c07c into typelevel:master Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants