-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Reproducer:
fun createNStreams(n,s) {
fun f (n) iterate x in s { if moduloI(x,n) == 0 then emit x };
fun g (n) if n == 1 then [] else f(n):::g(n-1);
g(n)
}
The inferred type of this function is:
createNStreams :: (#a, Stream Int) -> List 'b;
This bug can be sidestepped by providing a correct type signature. The compiler accepts the correct type signature provided. For this particular function:
createNStreams :: (Int, Stream Int) -> List (Stream Int);