Re: [Haskell-cafe] converting prefixes of CString - String

2011-04-26 Thread Malcolm Wallace
On 25 Apr 2011, at 08:16, Eric Stansifer wrote: Let 'c2h' convert CStrings to Haskell Strings, and 'h2c' convert Haskell Strings to CStrings. (If I understand correctly, c2h . h2c === id, but h2c . c2h is not the identity on all inputs; That is correct. CStrings are 8-bits, and Haskell

Re: [Haskell-cafe] converting prefixes of CString - String

2011-04-26 Thread Eric Stansifer
Let 'c2h' convert CStrings to Haskell Strings, and 'h2c' convert Haskell Strings to CStrings.  (If I understand correctly, c2h . h2c === id, but h2c . c2h is not the identity on all inputs; That is correct.  CStrings are 8-bits, and Haskell Strings are 32-bits.   Converting from Haskell to C

Re: [Haskell-cafe] converting prefixes of CString - String

2011-04-26 Thread Malcolm Wallace
On 26 Apr 2011, at 13:31, Eric Stansifer wrote: Let 'c2h' convert CStrings to Haskell Strings, and 'h2c' convert Haskell Strings to CStrings. (If I understand correctly, c2h . h2c === id, but h2c . c2h is not the identity on all inputs; That is correct. CStrings are 8-bits, and Haskell

[Haskell-cafe] converting prefixes of CString - String

2011-04-25 Thread Eric Stansifer
I have been reading Foreign.C.String but it does not seem to provide the functionality I was looking for. Let 'c2h' convert CStrings to Haskell Strings, and 'h2c' convert Haskell Strings to CStrings. (If I understand correctly, c2h . h2c === id, but h2c . c2h is not the identity on all inputs;