Clerton Filho | 20 Dec 15:45

Storable types

Hi,

I'm newbie in Haskell, and I have some doubts... In this programming language, do we have storable values? Case affirmative, what are the storable types in Haskell, and how can I implement then...

thanks!

--
Clerton Ribeiro de Araujo Filho

Graduando em Ciência da Computação
Integrante do PET - Programa de Educação Tutorial
Integrante do LIA - Laboratório de Inteligência Artificial
Universidade Federal de Campina Grande - UFCG

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Storable types

Hallo fellow Brazilian,

Clerton Filho escreveu:
> Hi,
>
> I'm newbie in Haskell, and I have some doubts... In this programming 
> language, do we have storable values? Case affirmative, what are the 
> storable types in Haskell, and how can I implement then...

     What exactly is a storable type?

-alex
Henning Thielemann | 20 Dec 16:01

Re: Storable types


On Thu, 20 Dec 2007, Alex Sandro Queiroz e Silva wrote:

> Hallo fellow Brazilian,
>
> Clerton Filho escreveu:
> > Hi,
> >
> > I'm newbie in Haskell, and I have some doubts... In this programming
> > language, do we have storable values? Case affirmative, what are the
> > storable types in Haskell, and how can I implement then...
>
>      What exactly is a storable type?

I guess you mean:
  http://haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html

A type becomes storable by implementing the Storable methods, namely
sizeOf, aligment, peek, poke. To this end you can convert to and access
the Storable methods of CInt, CDouble and friends.
Jules Bean | 20 Dec 16:02

Re: Storable types

Clerton Filho wrote:
> Hi,
> 
> I'm newbie in Haskell, and I have some doubts... In this programming 
> language, do we have storable values? Case affirmative, what are the 
> storable types in Haskell, and how can I implement then...

Not entirely sure what you mean.

There is a haskell typeclass called Storable, but it probably isn't what 
you mean.

If you want persistence, serialisation, we have two options:

Read/Show is simple, slow and text-based. It's very helpful for 
debugging but not for high performance.

Data.Binary is fast, configurable and binary. That's a good solution for 
high-throughput persistence.

If you need versioning support, then the upper layer of Binary isn't for 
you. But the "guts" of binary, called Get and Put, make it simple to 
write your own versioned persistence.

Jules

Gmane