Unfortunately, the way that `or` patterns work in `match` doesn't allow
Typed Racket to figure out that those are always strings. You could try the
pattern `(list (or "CBOE" "XCBOE") NAME)` for this specific example, but
there isn't a fix in general, aside from not using `or` patterns or using
assert/cast.

Sam

On Wed, Dec 30, 2015 at 12:07 PM JCG <griffin...@gmail.com> wrote:

> Within typed/racket, the type of NAME below is (U False String).  The type
> of COUNTRY and INDICATOR are simply String.  The values are always String.
> All the (or) based patterns
>
> Any idea about how to have the (or pattern1 pattern2) identify as String?
> I can cast it of course, but prefer not to.
>
>
> (match a-list-of-strings
>
> [(list "COUNTRY" COUNTRY INDICATOR)
>          (trading-economics COUNTRY INDICATOR)]
>
> ...
>
>  [(or (list "CBOE" NAME)
>         (list "XCBOE" NAME))
>                  #:when (member NAME cboe-record-names)
>                  (cboe-series NAME)]
>
> --
> 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.

Reply via email to