From 2adb41310c16c43546a6855a1f6dbcc1c96dc344 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 13 Jun 2016 01:23:44 +0200 Subject: lib.lpad: init --- krebs/4lib/default.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'krebs/4lib') diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index da936fad..09d416d4 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -37,6 +37,11 @@ let out = rec { shell = import ./shell.nix { inherit lib; }; tree = import ./tree.nix { inherit lib; }; + lpad = n: c: s: + if stringLength s < n + then lpad n c (c + s) + else s; + toC = x: let type = typeOf x; reject = throw "cannot convert ${type}"; -- cgit v1.2.3