Re:Be wary of functions which take several parameters of the...
by bewo001 on Monday September 30, 2019 @11:12AM
(#21116175)
I want to agree, but the problem is that you now need 10 versions for many operations that are in a string library. Hidden assumptions -- like 'replacing a character in a string can never fail' -- may fail (eg in an email address type which only allows only a limited char set). Some constraints can't be expressed without dependent types (say you want to define a URI type that limits the length to 2000 chars total but is composed of variable length components, like the domain name, query strings etc).
[ Parent
| on HN ]
Re:Be wary of functions which take several parameters of the...
by michaelcampbell on Wednesday October 02, 2019 @05:17PM
(#21140826)
> but the problem is that you now need 10 versions for many operations that are in a string library
Do you? Or do you need just the operations for the things that are relevant to the type at hand? Limiting a broad API to the needed interface for the type you're modeling is a GOOD thing.