aboutsummaryrefslogtreecommitdiff
path: root/Semestr 2/racket/l11/solution.rkt
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2021-10-05 21:49:54 +0200
committerFranciszek Malinka <franciszek.malinka@gmail.com>2021-10-05 21:49:54 +0200
commitc5fcf7179a83ef65c86c6a4a390029149e518649 (patch)
treed29ffc5b86a0d257453cedcf87d91a13d8bf3b0d /Semestr 2/racket/l11/solution.rkt
parentf8a88b6a4aba1f66d04711a9330eaba49a50c463 (diff)
Duzy commit ze smieciami
Diffstat (limited to 'Semestr 2/racket/l11/solution.rkt')
-rw-r--r--Semestr 2/racket/l11/solution.rkt35
1 files changed, 0 insertions, 35 deletions
diff --git a/Semestr 2/racket/l11/solution.rkt b/Semestr 2/racket/l11/solution.rkt
deleted file mode 100644
index 55e4ba6..0000000
--- a/Semestr 2/racket/l11/solution.rkt
+++ /dev/null
@@ -1,35 +0,0 @@
-#lang racket
-
-(provide (contract-out
- [with-labels with-labels/c]
- [foldr-map foldr-map/c]
- [pair-from pair-from/c]))
-(provide with-labels/c foldr-map/c pair-from/c)
-
-
-(define with-labels/c (parametric->/c [a b] (-> (-> a b) (listof a) (listof (cons/c b (cons/c a null?))))))
-
-(define (with-labels f xs)
- (if (null? xs)
- null
- (cons (list (f (car xs)) (car xs)) (with-labels f (cdr xs)))))
-
-
-
-(define foldr-map/c (parametric->/c [x a f] (-> (-> x a (cons/c f a)) a (listof x) (cons/c (listof f) a))))
-
-(define (foldr-map f a xs)
- (define (it a xs ys)
- (if (null? xs)
- (cons ys a)
- (let [(p (f (car xs) a))]
- (it (cdr p)
- (cdr xs)
- (cons (car p) ys)))))
- (it a (reverse xs) null))
-
-
-(define pair-from/c (parametric->/c [x fx gx] (-> (-> x fx) (-> x gx) (-> x (cons/c fx gx)))))
-
-(define (pair-from f g)
- (lambda (x) (cons (f x) (g x)))) \ No newline at end of file