mTask's sequence operators sometimes lead to stack overflows.
Steps are lazy but sequences are not. While compiling, it should be checked whether it is safe to use a strict sequence and if not, fall back to a regular step.
For example, the following program leads to a stack overflow because the sequence is strictly evaluated.
declarePin D4 PMOutput \d4->
fun \blink=(\st->
writeD d3 st
>>|. delay (lit 500)
>>|. blink (not st)
) In {main = blink (lit True)}