[Haskell-cafe] How to avoid floods of fromIntegral (in ALSA.Sequencer)

Doug Burke dburke.gw at gmail.com
Sun Nov 3 22:08:24 UTC 2013


For Word8, take a look at Data.Word - e.g.

http://hackage.haskell.org/package/base-4.6.0.1/docs/Data-Word.html

Doug
 On Nov 3, 2013 12:36 PM, "martin" <martin.drautzburg at web.de> wrote:

> Am 11/03/2013 03:35 PM, schrieb Niklas Hambüchen:
> > It depends a bit:
> >
> > What is supposed to happen / what happens in your library when one of
> > the numbers is larger than a Word8?
> >
> > That usually determines where / how the conversion fits in nicely.
> >
> > For example, if you already know that all the values in DtzEvent can
> > only be Word8s, then they should probably already be Word8s and not Int.
>
>
> Silly me,
>
> yes using Word8 instead of Ints got rid of most of the fromIntegrals. I
> didn't know that Word8 was an actual haskell
> type. Thought it was something private to ALSA.Sequencer.
>
> There is one remaining fromIntegral. This is "time"
>
>
>     Couldn't match expected type
> `alsa-seq-0.6.0.2:Sound.ALSA.Sequencer.Marshal.Time.Tick'
>                 with actual type `T'
>
> This seems to be realy a private thing and I found to way other than
> fromIntegral to make the compiler happy.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131103/dc9bf015/attachment.html>


More information about the Haskell-Cafe mailing list