This commit is contained in:
Peter Harpending
2025-09-29 13:34:08 -07:00
parent 91f0064a5b
commit 5135a55081
6 changed files with 268 additions and 13 deletions
+11 -3
View File
@@ -1,4 +1,9 @@
% @doc called ltr to disambiguate from
% @doc called ltr to disambiguate from "char"
%
% In "A + B + AB", this is one of the individual letters.
%
% a letter is a binary. atom is more natural representation but this is http,
% can't be spamming the atoms table.
%
% mathematically, this is a variable like "a", "b", "c", etc
-module(wfc_ltr).
@@ -78,6 +83,9 @@ new2(Acc, Rest = <<BadChar:8, _/binary>>) ->
-spec to_binary(ltr()) -> binary().
-spec to_binary(ltr()) -> Result
when Result :: {ok, binary()}
| {error, string()}.
to_binary({c, X}) -> X.
to_binary({c, X}) -> {ok, X};
to_binary(Bad) -> {error, wfc_utils:str("wfc_ltr:to_binary: bad letter: ~tp", [Bad])}.