@@ -44,6 +44,7 @@ import Text.Regex.TDFA
4444import Prelude hiding (maximum , minimum )
4545import Prelude as P
4646
47+ infix 8 .^^ , `div`
4748infix 4 .== , .< , .<= , .>= , .> , ./=
4849infixr 3 .&&
4950infixr 2 .||
@@ -125,10 +126,10 @@ toDouble =
125126 )
126127
127128div :: (Integral a , Columnable a ) => Expr a -> Expr a -> Expr a
128- div = lift2Decorated Prelude. div " div" (Just " //" ) False 2
129+ div = lift2Decorated Prelude. div " div" (Just " //" ) False 7
129130
130131mod :: (Integral a , Columnable a ) => Expr a -> Expr a -> Expr a
131- mod = lift2Decorated Prelude. mod " mod" Nothing False 2
132+ mod = lift2Decorated Prelude. mod " mod" Nothing False 7
132133
133134(.==) :: (Columnable a , Eq a ) => Expr a -> Expr a -> Expr Bool
134135(.==) =
@@ -138,7 +139,7 @@ mod = lift2Decorated Prelude.mod "mod" Nothing False 2
138139 , binaryName = " eq"
139140 , binarySymbol = Just " =="
140141 , binaryCommutative = True
141- , binaryPrecedence = 1
142+ , binaryPrecedence = 4
142143 }
143144 )
144145
@@ -150,7 +151,7 @@ mod = lift2Decorated Prelude.mod "mod" Nothing False 2
150151 , binaryName = " neq"
151152 , binarySymbol = Just " /="
152153 , binaryCommutative = True
153- , binaryPrecedence = 1
154+ , binaryPrecedence = 4
154155 }
155156 )
156157
@@ -165,7 +166,7 @@ eq = (.==)
165166 , binaryName = " lt"
166167 , binarySymbol = Just " <"
167168 , binaryCommutative = False
168- , binaryPrecedence = 1
169+ , binaryPrecedence = 4
169170 }
170171 )
171172
@@ -180,7 +181,7 @@ lt = (.<)
180181 , binaryName = " gt"
181182 , binarySymbol = Just " >"
182183 , binaryCommutative = False
183- , binaryPrecedence = 1
184+ , binaryPrecedence = 4
184185 }
185186 )
186187
@@ -195,7 +196,7 @@ gt = (.>)
195196 , binaryName = " leq"
196197 , binarySymbol = Just " <="
197198 , binaryCommutative = False
198- , binaryPrecedence = 1
199+ , binaryPrecedence = 4
199200 }
200201 )
201202
@@ -210,7 +211,7 @@ leq = (.<=)
210211 , binaryName = " geq"
211212 , binarySymbol = Just " >="
212213 , binaryCommutative = False
213- , binaryPrecedence = 1
214+ , binaryPrecedence = 4
214215 }
215216 )
216217
@@ -228,7 +229,7 @@ and = (.&&)
228229 , binaryName = " and"
229230 , binarySymbol = Just " &&"
230231 , binaryCommutative = True
231- , binaryPrecedence = 1
232+ , binaryPrecedence = 3
232233 }
233234 )
234235
@@ -243,7 +244,7 @@ or = (.||)
243244 , binaryName = " or"
244245 , binarySymbol = Just " ||"
245246 , binaryCommutative = True
246- , binaryPrecedence = 1
247+ , binaryPrecedence = 2
247248 }
248249 )
249250
@@ -328,10 +329,10 @@ zScore :: Expr Double -> Expr Double
328329zScore c = (c - mean c) / stddev c
329330
330331pow :: (Columnable a , Num a ) => Expr a -> Int -> Expr a
331- pow _ 0 = Lit 1
332- pow ( Lit n) i = Lit (n ^ i)
333- pow expr 1 = expr
334- pow expr i = lift2Decorated (^) " pow " ( Just " ^ " ) False 3 expr (lit i)
332+ pow expr i = lift2Decorated (^) " pow " ( Just " ^ " ) False 8 expr (lit i)
333+
334+ (.^^) :: ( Columnable a , Num a ) => Expr a -> Int -> Expr a
335+ (.^^) = pow
335336
336337relu :: (Columnable a , Num a , Ord a ) => Expr a -> Expr a
337338relu = lift (Prelude. max 0 )
0 commit comments