lib.lpad: init

This commit is contained in:
tv 2016-06-13 01:23:44 +02:00
parent 3c61d227cf
commit 2adb41310c

View File

@ -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}";