[racket] missing solution 20.2.2 ex:fancy-contracts

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Sep 8 20:51:43 EDT 2014

Yes. 


On Sep 3, 2014, at 9:30 AM, Daniel Bastos wrote:

> A candidate for a solution.
> 
> Exercise 20.2.2. Formulate contracts for the following functions:
> 
> 1. sort, which consumes a list of numbers and a function that consumes
> two numbers (from the list) and produces a boolean; sort produces a
> list of numbers.
> 
> 2. map, which consumes a function from numbers to numbers and a list
> of numbers; it also produces a list of numbers.
> 
> 3. project, which consumes a list of lists of symbols and a function
> from lists of symbols to symbols; it produces a list of symbols.
> 
> Solution.
> 
> sort: (listof number) (number number -> boolean) -> (listof number)
> 
> map: (number -> number) (listof number) -> (listof number)
> 
> project: (listof (listof symbol)) ((listof symbol) -> symbol) -> (listof symbol)
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.