[containers-users] Possible additions to Containers and Friends

Simon Cruanes simon.cruanes.2007 at m4x.org
Tue Feb 27 00:11:32 GMT 2018


Le Mon, 26 Feb 2018, peter frey wrote:
> Simon occasionally includes code from some other part of the libraries to
> avoid requiring, say, Gen to access Sequence or Containers; I don't remember
> offhand.  In the case of some tiny piece of code thats sensible. (And so far
> that is all I have provided)

Indeed, and I find it sensible too to have a basic UTF8 encoder/decoder.

> Pervasives has now a type uchar which Uutf uses consistently. In the case
> that one is not dealing with the many exigencies that Uutf deals with, thats
> a bit overkill?  Alain Frisch used ints in Ulex and I remember another usage
> of uchar only in Camomille.
> 
> Uutf has a smaller range of codes that it accepts; namely Utf8.
> Thats 0 to (1024 * 16) + (1024 * 16) + (64 * 1024) where 64k portion at the
> end is also excluded from the 1Mb range before.
> 
> Originally Utf8 encoded all possible codes in the positive int32 range.
> I prefer to revert to the old standard; (and call it Utf31) since I this
> allows me to encode alphabets that are larger than, but include, the utf8
> range.  (This may not work with js_of_ocaml; but not all applications
> involve the web)

I'm not sure I understand, what is the point of supporting "more" than
utf8?

> When it comes to comparing utf8 chars (codes; ints) consider the following:
> 
> utop # ((=));;
> - : 'a -> 'a -> bool = <fun> after loading utop
> utop # open Containers;;
> utop # ((=));;
> - : int -> int -> bool = <fun>                      type is overloaded
> utop #
> 
> ( I noticed this also in Jane Streets's "Sequence" .  Possibly they want to
> avoid 'polymorphic'  comparisons; i.e.: comparisons that examine the
> internal structure)
> 
> Did you intend to do that?

It's intended, yes. You can find a rationale for it in the CHANGELOG
file or on release notes for 2.0.


-- 
Simon Cruanes

http://weusepgp.info/
key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3  7D8D 4AC0 1D08 49AA 62B6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ocaml.org/pipermail/containers-users/attachments/20180226/7509e82b/attachment.sig>


More information about the Containers-users mailing list