I will try to state this question as short and to the point as possible.
I expected this computation to complete after inputting three characters to the command line. However, it does not. I am curious as to why this is.
return . take 3 =<< sequence (repeat getChar)
Edit:
I should add that I am trying to separate selection from generation and therefore wish to produce an infinite stream of characters that I select from.
=<<complete before effects to the left of=<<begin.=<<would run forever then the entire action will run forever.sequencetakes a list of actions and gives back an action that performs all those actions.sequencean infinite list of actions, it will run forever.repeattakes a value, and gives an infinite list of that value, repeated.Do you see now why you get the behaviour you experience?
This would work, because there is no infinite list:
But presumably your real selection function is more complicated than “take the first three”. What is it?