aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ravanan/reader.scm14
-rw-r--r--ravanan/workflow.scm11
2 files changed, 13 insertions, 12 deletions
diff --git a/ravanan/reader.scm b/ravanan/reader.scm
index 69c9d55..6ca36bc 100644
--- a/ravanan/reader.scm
+++ b/ravanan/reader.scm
@@ -28,7 +28,8 @@
#:use-module (ravanan work utils)
#:use-module (ravanan work vectors)
#:export (read-workflow
- read-inputs))
+ read-inputs
+ coerce-type))
(define (preprocess-include tree)
(cond
@@ -269,3 +270,14 @@ each association list of the returned vector of association lists. If
(call-with-input-file (basename inputs-file)
json->scm)
(read-yaml-file (basename inputs-file)))))))
+
+(define (coerce-type val type)
+ "Coerce @var{val} to @var{type}."
+ ;; This function exists to handle YAML's type ambiguities.
+ (case type
+ ((boolean)
+ (cond
+ ((member val (list "true" "yes")) #t)
+ ((member val (list "false" "no")) #f)
+ (else (error "Unable to coerce value to type" val type))))
+ (else val)))
diff --git a/ravanan/workflow.scm b/ravanan/workflow.scm
index af720a8..989c711 100644
--- a/ravanan/workflow.scm
+++ b/ravanan/workflow.scm
@@ -157,17 +157,6 @@ requirements and hints of the step."
(list (subset-requirements parent-hints)
(subset-requirements step-hints)))))))
-(define (coerce-type val type)
- "Coerce @var{val} to @var{type}."
- ;; This function exists to handle YAML's type ambiguities.
- (case type
- ((boolean)
- (cond
- ((member val (list "true" "yes")) #t)
- ((member val (list "false" "no")) #f)
- (else (error "Unable to coerce value to type" val type))))
- (else val)))
-
(define (optional-input? input)
"Return @code{#t} if @var{input} is optional. Else, return @code{#f}."
;; Inputs that either have a default or accept null values are optional.