I am new to Haskell.
I am trying to write a program which given a list as an input replicates each element of list k times, where
k = position of element in list.
Another condition is solution has to use
Till now code I have written is :
replic  =  replic (x:xs) = map (replicate 2 ) [x] ++ replic xs
This replicates every element twice as replicate has input parameter
What I need is
replicate function should be given input as
1 ,2 ,3 in consecutive calls. So I need a counter. How can I use the counter there or do anything else that will give me position of element?