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,
`<Byte-Larger-Than-One>`?

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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to