X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=hs-rrdtool.git;a=blobdiff_plain;f=Database%2FRRDtool%2FExpression.hs;h=fa6aa5452cd2137d494ee624bcacfb3e77f89612;hp=19a241fe053b69a1d9ebddaf7c04e4a33c5904b0;hb=000307857df5266907964aff4ecc9e118314fe3f;hpb=256aad40f96ce034bc1aebd3302ecd8a86419163 diff --git a/Database/RRDtool/Expression.hs b/Database/RRDtool/Expression.hs index 19a241f..fa6aa54 100644 --- a/Database/RRDtool/Expression.hs +++ b/Database/RRDtool/Expression.hs @@ -56,16 +56,16 @@ type family IsCommonExpr e type family IsIterativeExpr e type family IsExprSet es -type instance IsExprSet HNil = True -type instance IsExprSet (HCons e es) = IsExpr e :&&: IsExprSet es +type instance IsExprSet Nil = True +type instance IsExprSet (Cons e es) = IsExpr e :&&: IsExprSet es type family IsCommonExprSet es -type instance IsCommonExprSet HNil = True -type instance IsCommonExprSet (HCons e es) = IsCommonExpr e :&&: IsCommonExprSet es +type instance IsCommonExprSet Nil = True +type instance IsCommonExprSet (Cons e es) = IsCommonExpr e :&&: IsCommonExprSet es type family IsIterativeExprSet es -type instance IsIterativeExprSet HNil = True -type instance IsIterativeExprSet (HCons e es) = IsIterativeExpr e :&&: IsIterativeExprSet es +type instance IsIterativeExprSet Nil = True +type instance IsIterativeExprSet (Cons e es) = IsIterativeExpr e :&&: IsIterativeExprSet es -- Constants and variable names data Constant @@ -75,20 +75,20 @@ data Constant type instance IsExpr Constant = True type instance IsCommonExpr Constant = True type instance IsIterativeExpr Constant = True -type instance MentionedVars Constant = HNil +type instance MentionedVars Constant = Nil {- This is what we want to do but GHC can't handle this for now. -class ( (HLengthOf str :<=: D19) ~ True +class ( (Length str :<=: D19) ~ True , HString str ) => IsVarName str -} type family IsVarName str -type instance IsVarName str = ( (HLength str :>: D0) +type instance IsVarName str = ( (Length str :>: D0) :&&: - (HLength str :<=: D19) + (Length str :<=: D19) :&&: - (HAll IsGoodLetterForVarNameA str) + (All IsGoodLetterForVarNameA str) ) type family IsGoodLetterForVarName c @@ -112,11 +112,11 @@ data Variable vn = Var !vn 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 :&: Nil type family IsVariableSet vs -type instance IsVariableSet HNil = True -type instance IsVariableSet (HCons v vs) = IsVarName v :&&: IsVariableSet vs +type instance IsVariableSet Nil = True +type instance IsVariableSet (Cons v vs) = IsVarName v :&&: IsVariableSet vs -- Common operators data CommonUnaryOp a @@ -200,7 +200,7 @@ data CommonSetOp es type instance IsExpr (CommonSetOp es) = IsExprSet es type instance IsCommonExpr (CommonSetOp es) = IsCommonExprSet es type instance IsIterativeExpr (CommonSetOp es) = IsIterativeExprSet es -type instance MentionedVars (CommonSetOp es) = HConcat (HMap MentionedVarsA es) +type instance MentionedVars (CommonSetOp es) = Concat (Map MentionedVarsA es) -- TrendOp data TrendOp vn e @@ -260,7 +260,7 @@ data CommonValue type instance IsExpr CommonValue = True type instance IsCommonExpr CommonValue = True type instance IsIterativeExpr CommonValue = True -type instance MentionedVars CommonValue = HNil +type instance MentionedVars CommonValue = Nil -- Iterative special values data IterativeValue @@ -273,7 +273,7 @@ data IterativeValue type instance IsExpr IterativeValue = True type instance IsCommonExpr IterativeValue = False type instance IsIterativeExpr IterativeValue = True -type instance MentionedVars IterativeValue = HNil +type instance MentionedVars IterativeValue = Nil -- Iterative special values of something data IterativeValueOf vn @@ -283,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 :&: Nil -- Aggregative operators (fairly restricted due to rrdtool's -- restriction) @@ -302,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 :&: Nil