Re: [racket-users] Typed Racket: Byte-Larger-Than-One is half-hidden half-exported

2015-10-06 Thread Vincent St-Amour
Hi Paolo,

I agree that the semi-private status of these types is not ideal.

I don't see how opaque type synonyms would solve that problem. Can you
elaborate?

As for qualifying names, there's no universal convention in Racket (you
can use any prefix you want with `prefix-in`). Would it help if these
"internal types" were printed differently from the others? Like, say,
``?

Vincent




On Sat, 03 Oct 2015 08:09:20 -0500,
Paolo Giarrusso wrote:
> 
> Hi all!
> While following Typed Racket's guide and learning about :type, I was confused 
> by "private" types like Byte-Larger-Than-One showing up. This is especially 
> confusing because it appears when learning about :type 
> (http://docs.racket-lang.org/ts-reference/Exploring_Types.html).
> 
> Byte-Larger-Than-One appears when exploring types:
> > (:type Positive-Byte)
> (U One Byte-Larger-Than-One)
> 
> Since Byte-Larger-Than-One appears there, I assumed I could use :type on it:
> > (:type Byte-Larger-Than-One)
> . Type Checker: parse error in type;
>  type name `Byte-Larger-Than-One' is unbound in: Byte-Larger-Than-One
> 
> However, it later turned out that you can explore most types appearing there, 
> just not Byte-Larger-Than-One (and, in fact, some other types)
> > (:type One)
> 1
> 
> I've found a comment in sources explaining why such types are not exposed 
> (https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/types/numeric-tower.rkt#L36).
>  However, in fact they are somewhat exposed when browsing types, which seems 
> suboptimal.
> 
> Would it make sense to have and use opaque type synonyms for these cases?
> Alternatively, Haskell automatically qualifies type identifiers which are not 
> in scope, and maybe Racket could do something similar ― although I know no 
> syntax for module-qualified names in Racket.
> 
> Cheers,
> Paolo
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Typed Racket: Byte-Larger-Than-One is half-hidden half-exported

2015-10-06 Thread Sam Tobin-Hochstadt
I think the right solution is just to provide them as real types.
Hiding them incompletely doesn't work, and it will be difficult to
hide them completely.

Sam

On Tue, Oct 6, 2015 at 3:37 PM, Vincent St-Amour
 wrote:
> Hi Paolo,
>
> I agree that the semi-private status of these types is not ideal.
>
> I don't see how opaque type synonyms would solve that problem. Can you
> elaborate?
>
> As for qualifying names, there's no universal convention in Racket (you
> can use any prefix you want with `prefix-in`). Would it help if these
> "internal types" were printed differently from the others? Like, say,
> ``?
>
> Vincent
>
>
>
>
> On Sat, 03 Oct 2015 08:09:20 -0500,
> Paolo Giarrusso wrote:
>>
>> Hi all!
>> While following Typed Racket's guide and learning about :type, I was 
>> confused by "private" types like Byte-Larger-Than-One showing up. This is 
>> especially confusing because it appears when learning about :type 
>> (http://docs.racket-lang.org/ts-reference/Exploring_Types.html).
>>
>> Byte-Larger-Than-One appears when exploring types:
>> > (:type Positive-Byte)
>> (U One Byte-Larger-Than-One)
>>
>> Since Byte-Larger-Than-One appears there, I assumed I could use :type on it:
>> > (:type Byte-Larger-Than-One)
>> . Type Checker: parse error in type;
>>  type name `Byte-Larger-Than-One' is unbound in: Byte-Larger-Than-One
>>
>> However, it later turned out that you can explore most types appearing 
>> there, just not Byte-Larger-Than-One (and, in fact, some other types)
>> > (:type One)
>> 1
>>
>> I've found a comment in sources explaining why such types are not exposed 
>> (https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/types/numeric-tower.rkt#L36).
>>  However, in fact they are somewhat exposed when browsing types, which seems 
>> suboptimal.
>>
>> Would it make sense to have and use opaque type synonyms for these cases?
>> Alternatively, Haskell automatically qualifies type identifiers which are 
>> not in scope, and maybe Racket could do something similar ― although I know 
>> no syntax for module-qualified names in Racket.
>>
>> Cheers,
>> Paolo
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Typed Racket: Byte-Larger-Than-One is half-hidden half-exported

2015-10-06 Thread Vincent St-Amour
We've considered this before, and I still think that the TR numeric
tower is already complex enough as is that I'm reluctant to expose more
bits, especially some that are not really meaningful, and should not
ever be used.

Vincent



On Tue, 06 Oct 2015 14:49:35 -0500,
Sam Tobin-Hochstadt wrote:
> 
> I think the right solution is just to provide them as real types.
> Hiding them incompletely doesn't work, and it will be difficult to
> hide them completely.
> 
> Sam
> 
> On Tue, Oct 6, 2015 at 3:37 PM, Vincent St-Amour
>  wrote:
> > Hi Paolo,
> >
> > I agree that the semi-private status of these types is not ideal.
> >
> > I don't see how opaque type synonyms would solve that problem. Can you
> > elaborate?
> >
> > As for qualifying names, there's no universal convention in Racket (you
> > can use any prefix you want with `prefix-in`). Would it help if these
> > "internal types" were printed differently from the others? Like, say,
> > ``?
> >
> > Vincent
> >
> >
> >
> >
> > On Sat, 03 Oct 2015 08:09:20 -0500,
> > Paolo Giarrusso wrote:
> >>
> >> Hi all!
> >> While following Typed Racket's guide and learning about :type, I was 
> >> confused by "private" types like Byte-Larger-Than-One showing up. This is 
> >> especially confusing because it appears when learning about :type 
> >> (http://docs.racket-lang.org/ts-reference/Exploring_Types.html).
> >>
> >> Byte-Larger-Than-One appears when exploring types:
> >> > (:type Positive-Byte)
> >> (U One Byte-Larger-Than-One)
> >>
> >> Since Byte-Larger-Than-One appears there, I assumed I could use :type on 
> >> it:
> >> > (:type Byte-Larger-Than-One)
> >> . Type Checker: parse error in type;
> >>  type name `Byte-Larger-Than-One' is unbound in: Byte-Larger-Than-One
> >>
> >> However, it later turned out that you can explore most types appearing 
> >> there, just not Byte-Larger-Than-One (and, in fact, some other types)
> >> > (:type One)
> >> 1
> >>
> >> I've found a comment in sources explaining why such types are not exposed 
> >> (https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/types/numeric-tower.rkt#L36).
> >>  However, in fact they are somewhat exposed when browsing types, which 
> >> seems suboptimal.
> >>
> >> Would it make sense to have and use opaque type synonyms for these cases?
> >> Alternatively, Haskell automatically qualifies type identifiers which are 
> >> not in scope, and maybe Racket could do something similar ― although I 
> >> know no syntax for module-qualified names in Racket.
> >>
> >> Cheers,
> >> Paolo
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "Racket Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to racket-users+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.