Reputation: 49
I have this function
func1 :: Double -> [(Double,Double)] -> Maybe [(Double,Double)]
...............
func2 :: Double -> [(Double,Double)] -> [(Double,Double)]
func2 d [] = []
func2 d list =
let dsegs1 = func1 d list
dsegs2 = func2 d (tail list)
in fromJust dsegs1 ++ dsegs2
The simple flow I would like to achieve in func2
is as follows:
let x = func2 3.0 list
let y = func2 3.0 (tail list)
let z = func2 3.0 (tail (tail list))
let a = func2 3.0 (tail (tail (tail list)))
call func2
n times until it returns nothing at the end and concat x
,y
,z
,..., a
.
How would I do that?
Upvotes: 0
Views: 237