-- Data.HList
, (.&.)
- , HNil(..)
+ , Nil(..)
-- Database.RRDtool.Expression
, Constant(..)
where
type DSName (ExternalDataSource vn) = vn
-type instance MentionedVars (ExternalDataSource vn) = HNil
+type instance MentionedVars (ExternalDataSource vn) = Nil
-- |ComputedDataSource is for storing the result of a formula applied
-- to other data sources in the RRD. This data source is not supplied
cdsName = "foo"
-- , cdsExpr = Previous :<: Const 100
-- , cdsExpr = Var "foo" :<: Const 100
- , cdsExpr = AverageOf (Const 100 .*. Const 200 .*. HNil)
+ , cdsExpr = AverageOf (Const 100 .*. Const 200 .*. Nil)
}
-}
newtype RRDInterval = RRDInterval NominalDiffTime
class RRDSpec s
-instance ( HOccurs RRDPath s
- , HOccursOpt KeepOldRRD s
- , HOccursOpt RRDStartTime s
- , HOccursOpt RRDInterval s
- , HOccurs RRDDataSources s
+instance ( Occurs RRDPath s
+ , OccursOpt KeepOldRRD s
+ , OccursOpt RRDStartTime s
+ , OccursOpt RRDInterval s
+ , Occurs RRDDataSources s
)
=> RRDSpec s
instance ( DSList l
, DataSource d
)
- => NonEmptyDSList (HCons d l)
+ => NonEmptyDSList (Cons d l)
class DSList l
-instance DSList HNil
+instance DSList Nil
instance ( DSList l
, DataSource d
)
- => DSList (HCons d l)
+ => DSList (Cons d l)
data RRDDataSources
= forall l.
( NonEmptyDSList l
- , HGraph l -- FIXME: this constraint is too weak
+ , Graph l -- FIXME: this constraint is too weak
)
=> RRDDataSources l
-- RRDDataSources is a graph.
instance ( DSList g
- , HNodeSet g
- , HNoDuplicates (HMap HNodeIDA g)
+ , NodeSet g
+ , NoDuplicates (Map NodeIDA g)
)
- => HGraph g
+ => Graph g
where
- type HNodes g = g
+ type Empty g = Nil
+ type Nodes g = g
-instance ( HNodeIDSet (MentionedVars d)
+type instance IsEmpty Nil = True
+type instance IsEmpty (Cons e l) = False
+
+instance ( NodeIDSet (MentionedVars d)
, DataSource d
)
- => HNode d
+ => Node d
where
- type HNodeID d = DSName d
- type HLinksFrom d = MentionedVars d
+ type NodeID d = DSName d
+ type LinksFrom d = MentionedVars d
-- |The 'createRRD' function lets you set up new Round Robin Database
-- (RRD) files. The file is created at its final, full size and filled
testMain = let s = RRDPath "test.rrd" .&.
KeepOldRRD .&.
RRDDataSources testDSList .&.
- HNil
+ Nil
in
createRRD s
cdsName = [$hString|baz|]
, cdsExpr = Var [$hString|foo|] -- should typecheck!
}
- in a .&. b .&. HNil
\ No newline at end of file
+ in a .&. b .&. Nil
\ No newline at end of file