From 2c2d8fbbdb2f99f278ee50fc30f203e4ed8634a6 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Tue, 3 May 2022 21:26:36 +0200 Subject: [PATCH] =?UTF-8?q?update-function-form->update-function=20?= =?UTF-8?q?=E2=86=92=20update-function-form->update-function/any?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- networks.rkt | 12 ++++++------ scribblings/networks.scrbl | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/networks.rkt b/networks.rkt index 2c796d7..d8b0938 100644 --- a/networks.rkt +++ b/networks.rkt @@ -16,7 +16,7 @@ make-01-domains make-01-network update UpdateFunctionForm (struct-out network-form) NetworkForm - update-function-form->update-function + update-function-form->update-function/any ) (define-type (State a) (VariableMapping a)) @@ -125,14 +125,14 @@ #:transparent #:type-name NetworkForm) - (: update-function-form->update-function (-> UpdateFunctionForm (UpdateFunction Any))) - (define (update-function-form->update-function form) + (: update-function-form->update-function/any (-> UpdateFunctionForm (UpdateFunction Any))) + (define (update-function-form->update-function/any form) (λ (s) (eval1-with s form))) (module+ test - (test-case "update-function-form->update-function" + (test-case "update-function-form->update-function/any" (define s (hash 'x #t 'y #f)) - (define f (update-function-form->update-function '(and x y))) + (define f (update-function-form->update-function/any '(and x y))) (check-equal? (f s) #f))) ) @@ -303,7 +303,7 @@ (define (network-form->network nf) (network (for/hash ([(x form) (in-hash (network-form-forms nf))]) - (values x (update-function-form->update-function form))) + (values x (update-function-form->update-function/any form))) (network-form-domains nf))) (module+ test diff --git a/scribblings/networks.scrbl b/scribblings/networks.scrbl index 14ab119..9de4846 100644 --- a/scribblings/networks.scrbl +++ b/scribblings/networks.scrbl @@ -232,13 +232,13 @@ The type of instances of @racket[network-form]. (hash 'a '(#f #t) 'b '(#f #t))) ]} -@defproc[(update-function-form->update-function [func UpdateFunctionForm]) - (UpdateFunction Any)]{ +@defproc[(update-function-form->update-function/any [func UpdateFunctionForm]) + (UpdateFunction Any)]{ Builds an update function from an update function form. @ex[ -(define and-from-form (update-function-form->update-function '(and x y))) +(define and-from-form (update-function-form->update-function/any '(and x y))) (and-from-form (hash 'x #f 'y #f)) (and-from-form (hash 'x #f 'y #t)) (and-from-form (hash 'x #t 'y #f))