Maybe this line:
#:first-order (λ (c) (if (barrier-contract-positive? c)
(barrier-contract-pred c) (λ (x) #t)))
On Tue, Nov 28, 2017 at 8:02 PM, Ben Greenman
> 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))
> 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 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
For more options, visit https://groups.google.com/d/optout.