{- |
Provide a class that renders multiple Haskell values in a text form
that is accessible by gnuplot.
Maybe we add a method for the binary interface to gnuplot later.
-}moduleGraphics.Gnuplot.Value.Tuple(C(text,number),)whereimportSystem.Locale(defaultTimeLocale,)importqualifiedData.TimeasTimeimportData.Word(Word8,Word16,Word32,Word64,)importData.Int(Int8,Int16,Int32,Int64,)importData.Ratio(Ratio,)classCawheretext::a->[ShowS]{- |
The right pair member is a dummy result
that is needed only for type inference.
Expect that it is undefined
-}number::(Int,a)number=(1,error"gnuplot: dummy tuple value")singleton::a->[a]singleton=(:[])instanceCFloatwheretext=singleton.showsinstanceCDoublewheretext=singleton.showsinstanceCIntwheretext=singleton.showsinstanceCIntegerwheretext=singleton.showsinstance(Integrala)=>C(Ratioa)wheretext=singleton.shows.(id::Double->Double).realToFracinstanceCInt8wheretext=singleton.showsinstanceCInt16wheretext=singleton.showsinstanceCInt32wheretext=singleton.showsinstanceCInt64wheretext=singleton.showsinstanceCWord8wheretext=singleton.showsinstanceCWord16wheretext=singleton.showsinstanceCWord32wheretext=singleton.showsinstanceCWord64wheretext=singleton.showsinstanceCTime.Daywheretextd=text$Time.UTCTimed0instanceCTime.UTCTimewheretext=singleton.showString.Time.formatTimedefaultTimeLocale"%s"instance(Ca,Cb)=>C(a,b)wheretext(a,b)=texta++textbnumber=let(na,a)=number(nb,b)=numberin(na+nb,(a,b))instance(Ca,Cb,Cc)=>C(a,b,c)wheretext(a,b,c)=texta++textb++textcnumber=let(na,a)=number(nb,b)=number(nc,c)=numberin(na+nb+nc,(a,b,c))instance(Ca,Cb,Cc,Cd)=>C(a,b,c,d)wheretext(a,b,c,d)=texta++textb++textc++textdnumber=let(na,a)=number(nb,b)=number(nc,c)=number(nd,d)=numberin(na+nb+nc+nd,(a,b,c,d))