
14 May
2007
14 May
'07
11:36 a.m.
Henning Thielemann
exactly 0 p = return [] exactly n p = do x <- p xs <- exactly (n-1) p return (x:xs)
Is there a difference between 'exactly' and 'replicateM' ?
With this definition, clearly not. But when rewritten to use lazy application, there is certainly a pragmatic difference in where the bottoms (if any) are located in the result. Regards, Malcolm