Question: the code below is my Haskell code, how will it look like if I have to turn it in to Scala code or Scala pseudocode?
the code below is my Haskell code, how will it look like if I have to turn it in to Scala code or Scala pseudocode?
This is my Haskell code:
split :: [a] -> Int -> [[a]]
split l1 n = [( take n l1 )] ++ [( drop n l1 )]
[split is a function which takes as parameters a list and an Integer n, indicating the splitting point. It splits the contents of the provided list into two lists, the first with the first n elements of the list (in order), and the second with the remaining elements (again, in order). These two lists are then returned as a list of two lists. ]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
