From 9756eb0806aef63137ed53c7f78eee13aa3db9d7 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 1 Nov 2019 14:24:24 -0700 Subject: add buildHaskellApp nix function --- com/simatime/bild.scm | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'com/simatime/bild.scm') diff --git a/com/simatime/bild.scm b/com/simatime/bild.scm index 604a545..44f6c74 100755 --- a/com/simatime/bild.scm +++ b/com/simatime/bild.scm @@ -122,6 +122,9 @@ exec guile -e "(@ (com simatime bild) main)" -s "$0" "$@" (define-module (com simatime bild) #:use-module ((ice-9 popen) #:prefix popen/) #:use-module ((ice-9 format) #:select (format)) + #:use-module ((ice-9 rdelim) #:prefix rdelim/) + #:use-module ((com simatime shell) #:prefix sh/) + #:use-module ((com simatime string) #:prefix string/) #:export (ns? ns->path path->ns @@ -156,24 +159,3 @@ exec guile -e "(@ (com simatime bild) main)" -s "$0" "$@" ((symbol? path) (to-ns (symbol->string path))) ((string? path) (to-ns path)) (else (error "path should be a string or symbol"))))) - - -;; -;; general funs, to be moved to a core lib -;; - -(define (string/replace s match replacement) - (string-fold - (lambda (a b) - (let ((next-char (if (eq? a match) - replacement - a))) - (string-concatenate (list b (string next-char))))) - "" - s)) - -(define (sh/exec cmd) - (let* ((port (popen/open-input-pipe cmd)) - (ret (read port))) - (popen/close-pipe port) - ret)) -- cgit v1.2.3