Re: [racket-users] Poor documentation of List*

2020-06-03 Thread Ryan Culpepper
`(List* T)` is the same as `T`, just as `(list* x)` is the same as `x` (whether `x` is a list or not). > (require typed/racket) > (list* 4 5 6) - : (List* Positive-Byte Positive-Byte Positive-Byte) '(4 5 . 6) > (list* 6) - : Integer [more precisely: Positive-Byte] 6 > (:type

Re: [racket-users] Poor documentation of List*

2020-06-03 Thread Sam Tobin-Hochstadt
`(List* T)` is just `T`. This follows the behavior of the `list*` function, where `(list* 5)` produces 5. You can explore this using the `:type` form at the REPL. For example, ``` > (:type (List* String)) String > (:type (List* String String)) (Pairof String String) > (:type (List* String (List

Re: [racket-users] Poor documentation of List*

2020-06-03 Thread Hendrik Boom
On Wed, Jun 03, 2020 at 04:22:41PM +0100, Stephen De Gabrielle wrote: > Hi Hendrik, > > I can't see the example you mention in > https://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.List%2A%29%29 > > i'm assuming (List*

Re: [racket-users] Poor documentation of List*

2020-06-03 Thread Stephen De Gabrielle
Hi Hendrik, I can't see the example you mention in https://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.List%2A%29%29 i'm assuming (List* c) is shorthand for (Pair c null)? I don't know typed racket so I've probably got

[racket-users] Poor documentation of List*

2020-06-02 Thread Hendrik Boom
In the Typed Racket Reference, List* is defined as follows: (List* t t1 ... s) is equivalent to (Pairof t (List* t1 ... s)). Following this definition down, we get (List* a b c) -> (Pairof a (List* b c)) -> (Pairof a (Pairof b (List* c))) But what's (List* c) ? I see no explanatory