Predicates can be used as contracts, so:

(define (non-empty-hash? x)
  (and (hash? x)
       (not (hash-empty? x))))

Then you can use `non-empty-hash?` as your contract.



On Mon, Jun 12, 2017 at 3:56 PM, David Storrs <david.sto...@gmail.com> wrote:
> There is a non-empty-listof contract but no non-empty-hashof contract.  Is
> there a way to build one?
>
> --
> 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