Question: in haskell Extracts a sublist of elements in range [M,N) from the input list. Returns a tuple containing the sublist and the input list with
in haskell Extracts a sublist of elements in range [M,N) from the input list. Returns a tuple containing the sublist and the input list with the sublist removed. Examples: sublist (2,7) [0..10] => ([2,3,4,5,6],[0,1,7,8,9,10]) sublist (3,4) [0..10] => ([3],[0,1,2,4,5,6,7,8,9,10]) sublist (5,5) [0..10] => ([],[0,1,2,3,4,5,6,7,8,9,10]) sublist (0,12) "hello world!" => ("hello world!","") sublist (6,100) "hello world!" => ("world!","hello ") -} sublist :: (Int,Int) -- sublist range (M,N); M is inclusive, N exclusive -> [a] -- input list -> ([a],[a]) sublist = undefined
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
