Skip to content

Commit d2df3fe

Browse files
authored
feat: support cons-last for arrays (#1402)
1 parent 55255d3 commit d2df3fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Commands.hs

+2
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ commandConsLast ctx x xs =
400400
pure $ case xs of
401401
XObj (Lst lst) i t ->
402402
(ctx, Right (XObj (Lst (lst ++ [x])) i t)) -- TODO: should they get their own i:s and t:s
403+
XObj (Arr arr) i t ->
404+
(ctx, Right (XObj (Arr (arr ++ [x])) i t))
403405
_ -> evalError ctx "Applying 'cons-last' to non-list or empty list." (xobjInfo xs)
404406

405407
commandAppend :: BinaryCommandCallback

0 commit comments

Comments
 (0)