On Mon Feb 18 12:37:09 2019, TOBYINK wrote:
Show quoted text> On 2019-02-13T04:49:06Z, srchulo wrote:
> > declare Char, as StrLength[1, 1],
> > message { 'Char must be a Str of length 1' };
>
> What are potential use cases when you might want to accept an
> arbitrary string of length 1? I can imagine cases where you might want
> to accept, say, a single letter or a single byte. But accepting any
> Unicode character sounds like something that would be needed pretty
> rarely.
>
> The way you define it, Char would accept "a" or "A" or "1" or "ß" or
> "個" or the crying face emoji.
I'm making updates to my Short::URL module:
https://metacpan.org/pod/Short::URL
This allows you to map an ID to a string over a given alphabet, but each member of the alphabet should only be one character long, or it would break the algorithm. The examples you provided above would all be fine in this case. If you feel that this is a rare use case, I can just define it locally within my module.