Skip to content

Commit

Permalink
fix: allow String.concat to work on lists (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellerve committed Aug 30, 2022
1 parent e4adef0 commit d67e4be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ commandStringConcat ctx a =
case mapM unwrapStringXObj strings of
Left err -> evalError ctx err (xobjInfo a)
Right result -> (ctx, Right (XObj (Str (join result)) (Just dummyInfo) (Just StringTy)))
XObj (Lst strings) _ _ ->
case mapM unwrapStringXObj strings of
Left err -> evalError ctx err (xobjInfo a)
Right result -> (ctx, Right (XObj (Str (join result)) (Just dummyInfo) (Just StringTy)))
_ -> evalError ctx ("Can't call concat with " ++ pretty a) (xobjInfo a)

commandStringSplitOn :: BinaryCommandCallback
Expand Down

0 comments on commit d67e4be

Please sign in to comment.