On 2016-02-29 11:01:17 -0800, Nota Poin wrote: > I'm not sure what the qualitative distinction is between contracts and Typed > Racket. They seem like two syntaxes for what mostly amount to the same thing. > > [...] > > Is it that contracts are more general, not always necessarily contracts of > functions that operate on types?
Contracts are indeed more general. You can write arbitrarily complex checks in contracts, like that the given input-port is not closed, or that the number that was inputted is a power of 2. You can't express these properties in Typed Racket's types. The idea is that a Racket programmer will start hardening their program by writing contracts, possibly ones that are stronger checks than types. Eventually that programmer may want to add types to detect violations earlier or within a module, and may remove some of those manually-written contracts. Ideally you could add types *and* keep the contracts you wrote that are more expressive than the types. (we don't have that last step yet, but we should in the future) Cheers, Asumu -- 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.