lib.lpad: init
This commit is contained in:
parent
3c61d227cf
commit
2adb41310c
@ -37,6 +37,11 @@ let out = rec {
|
|||||||
shell = import ./shell.nix { inherit lib; };
|
shell = import ./shell.nix { inherit lib; };
|
||||||
tree = import ./tree.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
|
toC = x: let
|
||||||
type = typeOf x;
|
type = typeOf x;
|
||||||
reject = throw "cannot convert ${type}";
|
reject = throw "cannot convert ${type}";
|
||||||
|
Loading…
Reference in New Issue
Block a user