]> gitweb @ CieloNegro.org - hs-rrdtool.git/blobdiff - Database/RRDtool/Expression.hs
working on graph...
[hs-rrdtool.git] / Database / RRDtool / Expression.hs
index 5c44213e47fb2fa4649b82c489e5d543cc3af79d..19a241fe053b69a1d9ebddaf7c04e4a33c5904b0 100644 (file)
@@ -84,7 +84,9 @@ class ( (HLengthOf str :<=: D19) ~ True
     => IsVarName str
 -}
 type family   IsVarName str
-type instance IsVarName str = ( (HLength str :<=: D19)
+type instance IsVarName str = ( (HLength str :>: D0)
+                                :&&:
+                                (HLength str :<=: D19)
                                 :&&:
                                 (HAll IsGoodLetterForVarNameA str)
                               )
@@ -92,7 +94,7 @@ type instance IsVarName str = ( (HLength str :<=: D19)
 type family   IsGoodLetterForVarName c
 type instance IsGoodLetterForVarName c = ( ((c :>=: D65) :&&: (c :<=:  D90)) -- A-Z
                                            :||:
-                                           ((c :>=: D99) :&&: (c :<=: D122)) -- a-z
+                                           ((c :>=: D97) :&&: (c :<=: D122)) -- a-z
                                            :||:
                                            (c :==: D45) -- '-'
                                            :||:
@@ -104,14 +106,13 @@ instance ApplyT IsGoodLetterForVarNameA c where
     type Apply IsGoodLetterForVarNameA c = IsGoodLetterForVarName c
 
 -- Variable
-data Variable vn
-    = Variable !vn
-    deriving (Show, Eq, Ord)
+data Variable vn = Var !vn
+                   deriving (Show, Eq, Ord)
 
 type instance IsExpr          (Variable vn) = True
 type instance IsCommonExpr    (Variable vn) = True
 type instance IsIterativeExpr (Variable vn) = True
-type instance MentionedVars   (Variable vn) = vn :*: HNil
+type instance MentionedVars   (Variable vn) = vn :&: HNil
 
 type family   IsVariableSet vs
 type instance IsVariableSet HNil         = True
@@ -210,7 +211,7 @@ data TrendOp vn e
 type instance IsExpr          (TrendOp vn e) = IsVarName vn :&&: IsExpr e
 type instance IsCommonExpr    (TrendOp vn e) = IsVarName vn :&&: IsCommonExpr e
 type instance IsIterativeExpr (TrendOp vn e) = IsVarName vn :&&: IsIterativeExpr e
-type instance MentionedVars   (TrendOp vn e) = vn :*: MentionedVars e
+type instance MentionedVars   (TrendOp vn e) = vn :&: MentionedVars e
 
 -- VariableShiftPredictOp
 data VariableShiftPredictOp ss w vn
@@ -228,7 +229,7 @@ type instance IsIterativeExpr (VariableShiftPredictOp ss w vn)
     = IsIterativeExprSet ss :&&: IsIterativeExpr w :&&: IsVarName vn
 
 type instance MentionedVars (VariableShiftPredictOp ss w vn)
-    = vn :*: (MentionedVars ss :++: MentionedVars w)
+    = vn :&: (MentionedVars ss :++: MentionedVars w)
 
 -- FixedShiftPredictOp
 data FixedShiftPredictOp sm w vn
@@ -246,7 +247,7 @@ type instance IsIterativeExpr (FixedShiftPredictOp sm w vn)
     = IsIterativeExpr sm :&&: IsIterativeExpr w :&&: IsVarName vn
 
 type instance MentionedVars (FixedShiftPredictOp sm w vn)
-    = vn :*: (MentionedVars sm :++: MentionedVars w)
+    = vn :&: (MentionedVars sm :++: MentionedVars w)
 
 -- Common special values
 data CommonValue
@@ -282,7 +283,7 @@ data IterativeValueOf vn
 type instance IsExpr          (IterativeValueOf vn) = IsVarName vn
 type instance IsCommonExpr    (IterativeValueOf vn) = False
 type instance IsIterativeExpr (IterativeValueOf vn) = IsVarName vn
-type instance MentionedVars   (IterativeValueOf vn) = vn :*: HNil
+type instance MentionedVars   (IterativeValueOf vn) = vn :&: HNil
 
 -- Aggregative operators (fairly restricted due to rrdtool's
 -- restriction)
@@ -301,4 +302,4 @@ data AggregativeUnaryOp vn
     | LSLCorrel  !(Variable vn)
     deriving (Show, Eq, Ord)
 
-type instance MentionedVars (AggregativeUnaryOp vn) = vn :*: HNil
+type instance MentionedVars (AggregativeUnaryOp vn) = vn :&: HNil