[Haskell-beginners] strict evaluation and MIDI playback

Dennis Raddle dennis.raddle at gmail.com
Fri Nov 6 23:26:14 UTC 2015


​Thanks! I have a problem though. I read about automatic derivation of an
NFData instance. I have GHC version 7.10.2. I tried the code below, but I
get

Can't make a derived instance of Generic RawMidiEvent
  You need DeriveGeneric to derive an instance of this class.
In the data declaration for 'RawMidiEvent'


{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}

import GHC.Generics (Generic)
import Control.DeepSeq

data RawMidiEvent = RawMidiEvent
  { rmeStream :: Int
  , rmeChan :: Int
  , rmeStatus :: Int
  , rmeData1 :: Int
  , rmeData2 :: Int
  }
  deriving (Show,Eq,Generic,NFData)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151106/737b9083/attachment.html>


More information about the Beginners mailing list