From 0f971f5258a1021f72a858add23a9b557f138bfe Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Mon, 21 Dec 2020 23:34:14 +0100 Subject: [PATCH] utils.scrbl: Remove Composing typed functions. I exported everything to typed-compose now. --- scribblings/utils.scrbl | 44 ----------------------------------------- 1 file changed, 44 deletions(-) diff --git a/scribblings/utils.scrbl b/scribblings/utils.scrbl index 3f1284b..43aa250 100644 --- a/scribblings/utils.scrbl +++ b/scribblings/utils.scrbl @@ -116,50 +116,6 @@ passed in the first argument. } -@section{Composing typed functions} - -Typed Racket's @racket[compose] only takes two arguments, because in general it -is difficult to specify that the return types and the argument types should be -the same for two successive functions in the argument list. This section -defines some further utilities which make using @racket[compose] -more comfortable. - -@defproc[(compose-n [proc (-> a a)] ...) (-> a a)]{ - -Compose an arbitrary number of functions of type @racket[(-> a a)]. - -@examples[#:eval utils-evaluator -((compose-n add1 add1 add1) 3) -]} - -@defproc*[([(compose-3 [proc1 (-> c d)] [proc2 (-> b c)] [proc3 (-> a b)]) (-> a d)] - [(compose-4 [proc1 (-> d e)] [proc2 (-> c d)] [proc3 (-> b c)] [proc4 (-> a b)]) (-> a e)])]{ - -@racket[compose-i] composes @racket[i] functions. The rightmost function is -applied first. - -@examples[#:eval utils-evaluator -(define (s->n [x : String]) (cast (string->number x) Number)) -(define fancy-add1 (compose-3 print add1 s->n)) -fancy-add1 -(fancy-add1 "1") -]} - -@defform[(multi-compose func ...) - #:contracts ([func expression])]{ - -Expands to a code applying @racket[compose] in a pairwise manner to the given -expressions. For example, @racket[(multi-compose f1 f2 f3 f4)] expands to -@racket[(compose f1 (compose f2 (compose f3 f4)))]. - -@examples[#:eval utils-evaluator -((multi-compose add1 - (λ ([x : Number]) (* x 3)) - add1 - (λ ([x : Number]) (+ x 2))) - 3) -]} - @section{Org-mode interoperability} Org-mode supports laying out the output of code blocks as tables, which is very