about summary refs log tree commit diff
path: root/users/Profpatsch/writers
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2023-01-06T17·42+0100
committerProfpatsch <mail@profpatsch.de>2023-01-06T18·12+0000
commit37883389bc2a436c71dc62323db8748e6e2ad670 (patch)
tree627a6874bd2d99c18ad274208087e5fa3065d2a5 /users/Profpatsch/writers
parent396fdde0c054fde0a2169ba029ffb3e575627af6 (diff)
feat(users/Profpatsch): add writeHaskellInteractive r/5618
Instead of compiling the module, run it in interpreted mode. Saves on
linking times and can probably be driven to do cooler things in the
future, like calling functions directly via an environment variable or
something.

Change-Id: I9c835005462cdd86055fb7702630a44f78c36107
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7781
Autosubmit: Profpatsch <mail@profpatsch.de>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/Profpatsch/writers')
-rw-r--r--users/Profpatsch/writers/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/users/Profpatsch/writers/default.nix b/users/Profpatsch/writers/default.nix
index 0e8ad9635662..9fb69231a143 100644
--- a/users/Profpatsch/writers/default.nix
+++ b/users/Profpatsch/writers/default.nix
@@ -99,10 +99,22 @@ let
     };
 
 
+  ghcBins = libraries: depot.nix.getBins (pkgs.ghc.withPackages (_: libraries)) [ "runghc" ];
+
+  writeHaskellInteractive = name: { libraries, ghcArgs ? [ ] }: path:
+    depot.nix.writeExecline name { } ([
+      (ghcBins libraries).runghc
+      "--"
+    ] ++ ghcArgs ++ [
+      "--"
+      path
+    ]);
+
 in
 {
   inherit
     python3
     python3Lib
+    writeHaskellInteractive
     ;
 }