While trying to write concurrent code that forks off threads that sleep before doing some delayed actions using
GHCi, version 6.10.4, which is a pretty old version, I found some strange behavior. I used
map (flip addUTCTime time) [1..5]
to generate the times that the delayed actions should be performed, and the interpreter would lock up. When I changed it to
map (flip addUTCTime time) [1,2,3,4,5]
, everything worked as expected. Maybe there is something tricky in the implementation of
enumFromTo :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime]
No comments:
Post a Comment