<div dir="ltr">In general, for good or evil, Haskell generally decided to roll its own names for everything to do with the outside world. <div><br></div><div>Like I said, good or evil, because it leads to a consistent feel to the API, unlike, say something like PHP, but does raise the bar to initial entry into the language a bit. On the other hand, it strikes me as a worst of all choices to wind up with 1-2 functions that comply with outside naming, while everything else carries on as usual, because now users are in the business of memorizing exceptions rather than writing code.</div><div><br></div><div>Internally libraries often adopt a c_foo or other mangling convention for their own FFI'd guts, but it isn't a thing base does.<br><div><br></div><div>I'd be more interested in one of the myriad alternative base/prelude projects picking up and running with what it looks like when the names of everything look like something out of gcc, than I would be particularly interested in bikeshedding this one name into a very "unhaskelly" form.</div><div><br></div><div>Names matching primitives modulo a hash is pretty universal as well.</div><div><br></div><div>-Edward</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 22, 2021 at 7:07 PM Viktor Dukhovni <<a href="mailto:ietf-dane@dukhovni.org">ietf-dane@dukhovni.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">An equivalent function of course already exists outside base:<br>
<br>
    $ hoogle 'CString -> IO CSize'<br>
    Data.ByteString.Internal c_strlen :: CString -> IO CSize<br>
<br>
unsurprisingly defined as:<br>
<br>
    foreign import ccall unsafe "string.h strlen" c_strlen<br>
        :: CString -> IO CSize<br>
<br>
Would it make sense to give the proposed new Foreign.C.Types function<br>
the same "c_strlen" name?  And then at some point in the future,<br>
Data.ByteString.Internal can just re-export it?<br>
<br>
Would using `cstringLength`, as proposed, be too confusable with the<br>
`cstringLength#` primop?<br>
<br>
-- <br>
    Viktor.<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>