[Haskell-cafe] bytestring vs. uvector

Xiao-Yong Jin xj2106 at columbia.edu
Tue Mar 10 16:52:50 EDT 2009


Don Stewart <dons at galois.com> writes:

> And what is Storable limited to?
>
> Ultimately they're all limited to the primops for reading and writing,
> and to what types we can encode in those. So:
>
>     primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
>     ...
> {-
> instance Storable Double
> instance Storable Bool
> instance Storable Char
> instance Storable Int
> instance Storable Float
> ...
> -}
>
> {-
>
> instance UA ()
> instance (UA a, UA b) => UA (a :*: b)
> instance UA Bool
> instance UA Char
> instance UA Int
> instance UA Float
> instance UA Double
> ...
> -}
>
> So what's a type that's Storable, but not writable in UA (or UArray or ..)

So it's me who understand it wrong.  If I want some high
performance array with elements of custom data type, I'm
stuck with Array, anyway?

Is it possible to make

instance UA UserDefinedDataType

I'm not sure how to do that.  Can you give me some
clarification?


Thanks,
Xiao-Yong
-- 
    c/*    __o/*
    <\     * (__
    */\      <


More information about the Haskell-Cafe mailing list