summaryrefslogtreecommitdiff
path: root/top/has-utils.scm
diff options
context:
space:
mode:
Diffstat (limited to 'top/has-utils.scm')
-rw-r--r--top/has-utils.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/top/has-utils.scm b/top/has-utils.scm
new file mode 100644
index 0000000..62a0c3f
--- /dev/null
+++ b/top/has-utils.scm
@@ -0,0 +1,21 @@
+;;; These utilities are specific to the Haskell language.
+
+(define (add-con-prefix str) ; should be in some utility file
+ (string-append ";" str))
+
+(define (remove-con-prefix string)
+ (substring string 1 (string-length string)))
+
+(define (has-con-prefix? string)
+ (char=? (string-ref string 0) '#\;))
+
+(define (add-con-prefix/symbol sym)
+ (string->symbol (add-con-prefix (symbol->string sym))))
+
+(define (remove-con-prefix/symbol sym)
+ (string->symbol (remove-con-prefix (symbol->string sym))))
+
+(define (has-con-prefix/symbol? sym)
+ (has-con-prefix? (symbol->string sym)))
+
+