Skip to content

Commit 49dae52

Browse files
committed
fix: Display instance of pow was wrong.
1 parent 3414512 commit 49dae52

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dataframe-symbolic-regression/dataframe-symbolic-regression.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ library
2222
-- other-modules:
2323
-- other-extensions:
2424
build-depends: base >= 4 && <5
25-
, dataframe
25+
, dataframe ^>= 0.4
2626
, attoparsec >=0.14.4 && <0.15
2727
, attoparsec-expr >=0.1.1.2 && <0.2
2828
, base >=4.19 && <5

src/DataFrame/Functions.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ pow :: (Columnable a, Num a) => Expr a -> Int -> Expr a
216216
pow _ 0 = Lit 1
217217
pow (Lit n) i = Lit (n ^ i)
218218
pow expr 1 = expr
219-
pow expr i = UnaryOp ("pow " <> T.pack (show i)) (^ i) expr
219+
pow expr i = BinaryOp "pow" (^) expr (lit i)
220220

221221
relu :: (Columnable a, Num a) => Expr a -> Expr a
222222
relu = UnaryOp "relu" (Prelude.max 0)

src/DataFrame/Internal/Expression.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ instance (Num a, Columnable a) => Num (Expr a) where
6969
(*) e (Lit 1) = e
7070
(*) (Lit x) (Lit y) = Lit (x * y)
7171
(*) e1 e2
72-
| e1 == e2 = UnaryOp "pow 2" (^ 2) e1
72+
| e1 == e2 = BinaryOp "pow" (^) e1 (Lit @Int 2)
7373
| otherwise = BinaryOp "mult" (*) e1 e2
7474

7575
fromInteger :: Integer -> Expr a

0 commit comments

Comments
 (0)