elerea icon indicating copy to clipboard operation
elerea copied to clipboard

Fail on improper use

Open divipp opened this issue 10 years ago • 1 comments

This is a feature request.

I wish elerea would fail on improper use. Of course, the best would be to fail during compilation but if it is not feasable still better to fail in runtime than silently go on. I think this way elerea users would be less surprised.

For example, consider the following code:

unspecified = do
    (sg, snk) <- externalMulti
    snk 0
    join $ start $ do
        s1 <- sg
        s2 <- sg
        return $ liftM2 (++) s1 s2

I think unspecified should return [0,0] but it returns [0]. This is not a bug, because the documentation of externalMulti sais that the generator can only be used once so I cannot complain.

divipp avatar Feb 02 '15 08:02 divipp

Well, it is true that there would be no downside to detecting this case.

cobbpg avatar Feb 02 '15 17:02 cobbpg