+-- |The name of the RRD you want to create. RRD files should end with
+-- the extension @.rrd@. However, RRDtool will accept any filename.
+newtype RRDPath = RRDPath FilePath
+
+-- |Do not clobber an existing file of the same name.
+data KeepOldRRD = KeepOldRRD
+
+-- |Specifies the time in seconds since @1970-01-01 UTC@ when the
+-- first value should be added to the RRD. RRDtool will not accept any
+-- data timed before or at the time specified. (default: @now - 10s@)
+newtype RRDStartTime = RRDStartTime POSIXTime
+
+-- |Specifies the base interval in seconds with which data will be fed
+-- into the RRD. (default: 300 sec)
+newtype RRDInterval = RRDInterval NominalDiffTime
+
+class RRDSpec s
+instance ( Occurs RRDPath s
+ , OccursOpt KeepOldRRD s
+ , OccursOpt RRDStartTime s
+ , OccursOpt RRDInterval s
+ , Occurs RRDDataSources s
+ )
+ => RRDSpec s
+
+class NonEmptyDSList l
+instance ( DSList l
+ , DataSource d
+ )
+ => NonEmptyDSList (Cons d l)
+
+class DSList l
+instance DSList Nil
+instance ( DSList l
+ , DataSource d
+ )
+ => DSList (Cons d l)
+
+data RRDDataSources
+ = forall l.
+ ( NonEmptyDSList l
+ , Graph l -- FIXME: this constraint is too weak
+ )
+ => RRDDataSources l
+
+-- RRDDataSources is a graph.
+instance ( DSList g
+ , NodeSet g
+ , NoDuplicates (Map NodeIDA g)
+ )
+ => Graph g
+ where
+ type Empty g = Nil
+ type Nodes g = g
+
+type instance IsEmpty Nil = True
+type instance IsEmpty (Cons e l) = False
+
+instance ( NodeIDSet (MentionedVars d)
+ , DataSource d
+ )
+ => Node d
+ where
+ type NodeID d = DSName d
+ type LinksFrom d = MentionedVars d
+