[Haskell-cafe] Beginners Question: Problem with Data Type Declaration

kaffeepause73 kaffeepause73 at yahoo.de
Thu Jun 16 10:42:12 CEST 2011


Hi Johan, 

actually quite obvious. Code works now, many thanks. :-)


import Data.Packed.Vector

data PowerSig = PowerSig Int Double (Vector Double) -- signal Index timeStep
data 

instance Show PowerSig where  
  show (PowerSig idx dt vector) = "PowerSignal Nr: " ++ show idx ++ "  dt: "
++ show dt ++ " val:" ++ show vector    
  
main = do 

        let p = PowerSig 5 0.1 (fromList [0..10::Double])
        putStrLn (show p)

--
View this message in context: http://haskell.1045720.n5.nabble.com/Beginners-Question-Problem-with-Data-Type-Declaration-tp4494012p4494166.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list