Pre-SIP, type aliasing with standard unary prefix operators without brackets

175 views
Skip to first unread message

oron...@gmail.com

unread,
Sep 16, 2016, 9:50:11 AM9/16/16
to scala-sips
Hi,

I started contributing to a singleton type operations library (see here, forked from here).

Scala allows to define infix alias operations so the following works nicely
//Just a syntax example. Nothing meaningful.
type
+[A,B] = Int
type MyPlus = Int + String

However, prefix unary operations do not receive the same justice:

type ![T] = T
type Not = ![Int]
type BadNot = !Int //Not working
type unary_-[P] = P
type Negate = unary_-[Int]
type BadNegate = -[Int] //Not working
type BadNegate2 = -Int //Not working
type ~[P] = P
type Tilda = ~[Int]
type BadTilda = ~Int //Not working

Since `-` is an infix operation, currently it is not possible to define a working prefix symbol example if the infix is included.


Happy to get your thoughts on the matter.
Oron

Scala Process

unread,
Sep 23, 2016, 5:51:27 AM9/23/16
to scala-sips
Hello Oron,

Following the rules of the Scala Process, I would suggest to wait longer to collect more feedback and thoughts on your proposal. How about inviting some people you may find knowledgeable on this matter to chime in? For instance, do you think the Typelevel folks would be interested in it? Who else?

If we don't get more feedback soon, I would encourage you to:
  1. Submit a proposal; and
  2. Invoke the SIP Process Lead (me, @jvican) or notify me in this thread.

Further instructions on the process can be found in the formal specification or the tutorial.


Thanks for sharing your thoughts!


Best,

- Jorge

Scala Process

unread,
Nov 14, 2016, 11:33:45 AM11/14/16
to scala-sips
Hello Oron,

I think it's about time to start formalizing this proposal, since it hasn't got any early feedback.

The next step is to submit a document explaining your proposal and its motivations, as well as an analysis of what it would need to be changed. If you're a little bit lost, you can use the Trailing Commas proposal as a source of inspiration. Since this is your first proposal, I would suggest you to keep it short and concise :)

The next steps are described in the formal specification an the tutorial. Let me know if you have any question.

Have a nice day!

- Jorge

oron...@gmail.com

unread,
Nov 17, 2016, 8:19:13 AM11/17/16
to scala-sips
Yes. I'm also considering extending the SIP proposal. I'm gathering my thoughts on this, and if I wish to extend it, I'll update to get more feedback on the extension.
If not, I will do was you say, and submit a formal specification.

Thanks,
Oron

Scala Process

unread,
Nov 17, 2016, 9:54:50 AM11/17/16
to scala...@googlegroups.com
There's no rush from our side, so take your time. Thanks to you!

Cheers,

- Jorge
--
You received this message because you are subscribed to a topic in the Google Groups "scala-sips" group.
To unsubscribe from this group and all its topics, send an email to scala-sips+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages