summaryrefslogtreecommitdiff
path: root/src/Parser/Expr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Parser/Expr.hs')
-rw-r--r--src/Parser/Expr.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Parser/Expr.hs b/src/Parser/Expr.hs
index eefc5cc..70649b2 100644
--- a/src/Parser/Expr.hs
+++ b/src/Parser/Expr.hs
@@ -289,10 +289,10 @@ someExpr = join inner <?> "expression"
SomeExpr e <- p
let err = parseError $ FancyError off $ S.singleton $ ErrorFail $ T.unpack $ T.concat
[ T.pack "value of type ", textExprType e, T.pack " does not have member '", m, T.pack "'" ]
- maybe err return $ applyRecordSelector e <$> lookup m recordMembers
+ maybe err return $ applyRecordSelector m e <$> lookup m recordMembers
- applyRecordSelector :: ExprType a => Expr a -> RecordSelector a -> SomeExpr
- applyRecordSelector e (RecordSelector f) = SomeExpr $ f <$> e
+ applyRecordSelector :: ExprType a => Text -> Expr a -> RecordSelector a -> SomeExpr
+ applyRecordSelector m e (RecordSelector f) = SomeExpr $ App (AnnRecord m) (pure f) e
literal = label "literal" $ choice
[ return <$> numberLiteral