You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when (length fromKeys /=length toVals) $ throwError $ErrorCall"builtins.replaceStrings: Arguments `from`&`to` construct a key-value map, so the number of their elements must always match."
948
949
949
950
let
950
-
-- 2021-02-18: NOTE: if there is no match - the process does not changes the context, but walks the string.
951
+
-- 2021-02-18: NOTE: if there is no match - the process does not changes the context, simply slides along the string.
951
952
-- So it should be more effective to pass the context as the first argument.
952
953
-- And moreover, the `passOneCharNgo` passively passes the context, to context can be removed from it and inherited directly.
954
+
-- Then the solution would've been elegant, but the Nix bug prevents elegant implementation.
953
955
go remaining processed ctx =
954
956
case maybePrefixMatch remaining of
955
957
Nothing->
956
958
-- Pass the chars until match
957
959
passOneCharNgo remaining processed ctx
958
-
Just (matched, replacementNS, tailNS) ->
959
-
-- Allowing match on "" is a bug-quirk of Nix,
960
-
-- when "" is checked - it always matches. And so - when it checks - it always insers a replacement, and then process simply passesthrough the char that was under match.
-- Allowing match on "" is a inherited bug of Nix,
969
+
-- when "" is checked - it always matches. And so - when it checks - it always insers a replacement, and then process simply passesthrough the char that was under match.
0 commit comments