[racket] [Typed Racket] "define-predicate" in Racket 5.3.4
That definitely looks like a bug. Can you file one either using the
bug report tool in the menus or at bugs.racket-lang.org.
No you cannot define a predicate like that, because you cannot tell a
functions type with a first order check. But you can use cast, so
(cast <function-expression> (Boolean -> Boolean)) should work.
On Thu, May 9, 2013 at 7:57 PM, Paul Leger <pleger at gmail.com> wrote:
> Hi all,
> In the Racket 5.3.4, I defined the following predicate
> >(define-predicate A? Procedure)
>
> and later, I tried using as follow:
> >(A? 'a)
>
> But I have the following error:
> >recursive-contract: contract violation
> >expected: flat-contract?
> >given: #<|chaperone-case->|>
>
> BTW, in this version, Is it possible to define predicate with a specific
> function?
> (define-type A (Boolean -> Boolean))
> (define-predicate A? A)
>
> Best,
> Paul
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>