[racket] Whats the difference between a predicate and a flat contract?

From: Harry Spier (vasishtha.spier at gmail.com)
Date: Tue Dec 4 15:09:19 EST 2012

Dear list members,

 I'm a little confused about the difference between the definition of a
 predicate and the definition of a flat contract.  If someone could
 clear that up I'd appreciate it.

 1) AT ALL PLACES in the documentation where it uses the term
 "predicate" does that mean a procedure that takes a single value and
 returns a boolean?  I inferred that from:
http://docs.racket-lang.org/reference/function-contracts.html#(def._((lib._racket/contract/base..rkt)._predicate/c))

 But from the section of the Racket Guide "Rolling your own contracts"
http://docs.racket-lang.org/guide/contract-func.html#(part._contracts-own)
 I inferred that a procedure that takes a value and returns a boolean
 can be used as a contract, so is a predicate always a flat-function?
 If thats so, then what does (flat-contract predicate)  do?
http://docs.racket-lang.org/reference/data-structure-contracts.html#(def._((lib._racket/contract/private/misc..rkt)._flat-contract))

 Thanks,
 Harry Spier

Posted on the users mailing list.