These are chat archives for typelevel/scala

20th
Sep 2016
Seth Tisue
@SethTisue
Sep 20 2016 00:45

What about LB/TS

better throw a "GNU/" in there too

BennyHill
@BennyHill
Sep 20 2016 10:31

@SethTisue GNU scalac? Any links?

@milessabin / Anyone. What/where are the latest "instructions" on building TLS, please?

Miles Sabin
@milessabin
Sep 20 2016 10:43
compile at the sbt prompt :-)
See the LBS readme ... there are no differences.
BennyHill
@BennyHill
Sep 20 2016 10:44
Ah, that old chestnut :)
thx :+1:
Oron Port
@soronpo
Sep 20 2016 10:56
@milessabin I added the following aliases to the singleton-ops lib, but I was kind of wondering if they shouldn't be included in TLS:
  type $Char                = Char with Singleton
  type $Int                 = Int with Singleton
  type $Long                = Long with Singleton
  type $Float               = Float with Singleton
  type $Double              = Double with Singleton
  type $String              = String with Singleton
  type $Boolean             = Boolean with Singleton
Guillaume Martres
@smarter
Sep 20 2016 10:57
Please don't use $ for identifiers in your source code
Miles Sabin
@milessabin
Sep 20 2016 10:58
I think for now they belong in libraries.
Guillaume Martres
@smarter
Sep 20 2016 10:58
it's (at least unofficially) reserved for identifiers generated by the compiler
Miles Sabin
@milessabin
Sep 20 2016 10:59
Also, what @smarter said wrt $.
Oron Port
@soronpo
Sep 20 2016 11:00
I understand the reluctance, but seems kind of appropriate for a short alias for a $ingleton.
You really think I must change this? Any suggestion?
Guillaume Martres
@smarter
Sep 20 2016 11:00
Actually it's in the spec: http://www.scala-lang.org/files/archive/spec/2.11/01-lexical-syntax.html "The $ character is reserved for compiler-synthesized identifiers"
Dale Wijnand
@dwijnand
Sep 20 2016 11:01
You're going to run into so many problems using $
Guillaume Martres
@smarter
Sep 20 2016 11:01
(in an ideal world, the compiler would warn you/not let you compile your code)
Oron Port
@soronpo
Sep 20 2016 11:02
It seems it compiles just fine (compiler bug?)
Oron Port
@soronpo
Sep 20 2016 11:03
Anyway, I'll change it. I'm still welcoming any ideas.
Merlin Göttlinger
@mgttlinger
Sep 20 2016 11:05
A Z for Zingleton or just an S maybe?
Oron Port
@soronpo
Sep 20 2016 11:06
I would have used S, but SInt looks like a signed-int, as apposed to UInt...
Merlin Göttlinger
@mgttlinger
Sep 20 2016 11:07
True.
Oron Port
@soronpo
Sep 20 2016 11:07
I'll think I'll go with you idea, but use X as an initial. XChar, XInt, etc.
Merlin Göttlinger
@mgttlinger
Sep 20 2016 11:11
I like that. Because the X looks like it marks a point and that fits the type only having one inhabitant (at least in my head :smile:).
Oron Port
@soronpo
Sep 20 2016 11:12
Plus X makes things sound cooler :smile:
@smarter Thanks for the warning about $.
Xingleton
Merlin Göttlinger
@mgttlinger
Sep 20 2016 11:13
:+1:
milessabin @milessabin not being completely serious ...
Oron Port
@soronpo
Sep 20 2016 11:15
heh
Don't get me tempted, or I'll use hebrew unicode characters
Miles Sabin
@milessabin
Sep 20 2016 11:17
What would you use for this?
Oron Port
@soronpo
Sep 20 2016 11:19
סingleton
Merlin Göttlinger
@mgttlinger
Sep 20 2016 11:19
Or just use another currency symbol as $ is reserved.
Oron Port
@soronpo
Sep 20 2016 11:20
ס Sounds like an S
Merlin Göttlinger
@mgttlinger
Sep 20 2016 11:20
€ingleton
Oron Port
@soronpo
Sep 20 2016 11:21
@mgttlinger While a nice idea, if it's not a default on the keyboard, I don't want it as an identifying character
Merlin Göttlinger
@mgttlinger
Sep 20 2016 11:21
And the hebrew characters are?
Oron Port
@soronpo
Sep 20 2016 11:22
I was joking, of course (On my keyboard they are)
But X is internationally placed
Oron Port
@soronpo
Sep 20 2016 11:27
@mgttlinger, I have now noticed that the hebrew letter ס is placed as the same key as X.
It is written in the (qwerty) stars that X is it!
Lars Hupel
@larsrh
Sep 20 2016 14:14
Have a look at the average Isabelle theory source code; there's so much Unicode going on there : smile:
Miles Sabin
@milessabin
Sep 20 2016 14:29
This bikeshed needs another coat of paint ... how about ß as in ßingleton (pronounced Ssingleton) ;-)
BennyHill
@BennyHill
Sep 20 2016 14:32
an upside-down S? :)
Merlin Göttlinger
@mgttlinger
Sep 20 2016 14:39
Sadly we can't use a 5 which would look similar enough and confuse everybody...
Dale Wijnand
@dwijnand
Sep 20 2016 14:40
"Shingleton", then everyone can just pretend to be Sean Connery
Merlin Göttlinger
@mgttlinger
Sep 20 2016 14:43
Ѕingleton (note that while this may look like an ordinary S it is actually 0x0405 "Cyrillic capital letter dze")
This would produce the best possible compile errors.
Miles Sabin
@milessabin
Sep 20 2016 14:47
Dzing!
Seth Tisue
@SethTisue
Sep 20 2016 15:59
LOL
BennyHill
@BennyHill
Sep 20 2016 18:37
So, should adding coverageOn to the TLS build cause any known issues?
Paul Phillips
@paulp
Sep 20 2016 19:21
@soronpo How much mileage are you getting out of those type aliases? Because typelevel/scala#114 And @milessabin you indicated another 2.11.8-based release is forthcoming and I assume it fixes that, anything I can do to help that along?
Oron Port
@soronpo
Sep 20 2016 19:52
@paulp At the moment, I'm experiencing no issues. But I have still bugs of my own and have yet to do extensive tests.
Paul Phillips
@paulp
Sep 20 2016 20:30
@soronpo Well, you can see the transcript in the linked ticket. Those aliases don't work as bounds, and personally I didn't have any other use for them. Maybe you had more ideas.
Oron Port
@soronpo
Sep 20 2016 20:32
I think I'm not getting a issue hit because it goes straight through to my macro. The use for it is shorter code.
Much nicer to write:
def demoLong[L1 <: XLong, L2 <: XLong](implicit p : Min[L1*L1, L2+L2]) : p.Out {} = p.value
Instead of
def demoLong[L1 <: Long with Singleton, L2 <: Long with Singleton](implicit p : Min[L1*L1, L2+L2]) : p.Out {} = p.value
Paul Phillips
@paulp
Sep 20 2016 20:33
If you're calling a macro the bounds are irrelevant, you could enforce the bounds in side the macro.
s/in side/inside/
Hey, that used to perform the substituion. Is there a time limit or something.
I guess there is.
or maybe it doesn't like whitespace, is likely.
Oron Port
@soronpo
Sep 20 2016 20:58
The bounds are relevant before the macro call. The implicit calls the macro. And the the definition won't run if L1 or L2 are outside of their bounds.
Oron Port
@soronpo
Sep 20 2016 21:18
How insane is this :smile:
  type LoopDemo[M] =
    ("$Cnt" := 0) ==>
    ("$Result" := 0) ==>
      While["$Cnt" <= M, ("$Result" += "$Cnt") ==> ("$Cnt" += 1), "$Result"]

    def demoLoop[M <: XInt](implicit op: LoopDemo[M]): op.Out {} = op.value
    val bLoop1 : 10 = demoLoop[4]
And this:
  type MyIfFunc[P1] = ITE[P1 < 0, 5, 7]
  def demoITE[P1 <: XInt](implicit op: MyIfFunc[P1]): op.Out {} = op.value
  val bITE1 : 7 = demoITE[1]
  val bITE2 : 5 = demoITE[-1]
Lars Hupel
@larsrh
Sep 20 2016 22:09
@soronpo that is actually pretty cool stuff
I think I'm going to steal this, if you don't mind :smile:
Oron Port
@soronpo
Sep 20 2016 22:10
This will soon be merged and released here : https://github.com/fthomas/singleton-ops
Good programmers copy. Great programmers steal.