summaryrefslogtreecommitdiff
path: root/Alpha.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-03-28 21:56:18 -0400
committerBen Sima <ben@bsima.me>2024-04-01 12:26:59 -0400
commit4e42fb581e67693ceb9f935f8e918c9b910ac98e (patch)
tree4e7fa8f88e449dc4d3959c8d895ebd38d159b731 /Alpha.hs
parentd56f05863d789423ff785cec654155d8495373a9 (diff)
Add --jobs and --cpus to bild
By default, nix will use the maximum amount of cores available to the machine. On my machine it was maxxing out the CPUs and then actually running out of RAM when compiling JavaScriptCore and literally shutting down my machine. So, I need to be able to control the concurrency and parallelism. The default settings I chose should reserve 4 cores for the user. I also changed --json to --plan because -j makes more sense for --jobs, as its used this way in other tools like make and nix-build.
Diffstat (limited to 'Alpha.hs')
-rw-r--r--Alpha.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Alpha.hs b/Alpha.hs
index e53474b..ba35e5b 100644
--- a/Alpha.hs
+++ b/Alpha.hs
@@ -83,7 +83,7 @@ import qualified Data.List as List
import Data.String
import qualified Data.Text as Text
import qualified Data.Text.Lazy as LazyText
-import Protolude as X hiding (list, ($), (&), (.), (>>=))
+import Protolude as X hiding (list, toS, ($), (&), (.), (>>=))
import Protolude.Conv
import qualified Prelude
@@ -248,7 +248,10 @@ wrap lim = Text.words .> wrap_ 0 .> Text.unwords
-- | Automatically convert any string-like type into any other string-like type,
-- using types to infer the appropriate conversion.
str :: (StringConv a b) => a -> b
-str = Protolude.Conv.toS
+str = toS
+
+instance StringConv Int String where
+ strConv _ = show
tshow :: Show a => a -> Text
tshow = show