The other day, I wanted to write a contract for a function that takes
any kind of vector and does something depending on whether the vector
is mutable. The contract was basically the one below:

```
#lang racket

(define/contract (f v)
  (parametric->/c [A]
    (-> (or/c (vectorof A #:immutable #true)
              (vectorof A #:immutable #false))
        any))
  (void))
```

When I try to call this function, I get an error "none of the branches
of the or/c matched".

It looks like this error is because `contract-first-order-passes?`
returns #false if the vector I pass to `f` has any elements.

Two questions:

1. Could `(contract-first-order-passes? ctc val)` return `#true` if
`ctc` is from a `parametric->/c` ? (I feel like it shouldn't but I
don't know why not)

2. If not, would `or/c` be better off using a
`contract-first-order-fails?` predicate?

-- 
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