On Monday 10 September 2007 21:02, apfelmus wrote:
[...]
class Put a endian where
put :: endian - a - Put
[...]
Oh, and the 8,16,32 and 64 are good candidates for phantom
type/associated data types, too.
I think that using any non-H98 feature like MPTC or associated data types for
* apfelmus wrote:
It's not that related, but I just got struck by an obvious idea, namely
to put the endianness in an extra parameter
data Endianness = Little | Big | Host
putInt32 :: Endianness - Int - Put
Please add the endianess to the state of the monad Put.
setendianess ::
Sven Panne wrote:
So what I was asking for is:
getInt32be, putIEEEFloatLe, getIEEEDoubleHost, ...
Type classes might be used to get a slightly smaller API, but I am unsure
about the performance impact and how much this would really buy us in terms
of the ease of use of the API.
It's