From 6cf1505a6191b1a02edd93ccfabd5035f491726f Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Tue, 8 Aug 2023 17:40:44 +0200 Subject: [PATCH] Add reaction and Reaction. --- rs.rkt | 8 +++++++- scribblings/rs.scrbl | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/rs.rkt b/rs.rkt index dffa68e..954edf2 100644 --- a/rs.rkt +++ b/rs.rkt @@ -4,12 +4,18 @@ (require typed/graph "utils.rkt" "dynamics.rkt") (provide - Species) + Species (struct-out reaction) Reaction) (module+ test (require typed/rackunit)) (define-type Species Symbol) + + (struct reaction ([reactants : (Setof Species)] + [inhibitors : (Setof Species)] + [products : (Setof Species)]) + #:transparent + #:type-name Reaction) ) (require graph "utils.rkt" "generic.rkt") diff --git a/scribblings/rs.scrbl b/scribblings/rs.scrbl index 9fe1de2..c3ececc 100644 --- a/scribblings/rs.scrbl +++ b/scribblings/rs.scrbl @@ -32,6 +32,21 @@ A synonym of @racket[Symbol]. } +@defstruct*[reaction ([reactants (Setof Species)] + [inhibitors (Setof Species)] + [products (Setof Species)])]{ + +A reaction is a triple of sets, giving the reactants, the inhibitors, +and the products, respectively. + +} + +@deftype[Reaction]{ + +The type of the instances of @racket[reaction]. + +} + @section{Org-mode interaction} This section contains some useful primitives for