Hey guys,<br><br>Right now I'm facing with a type problem that is really nasty, I want to compose a list of enumeratees using the ($=) operator to create a new enumerator. Whenever I'm trying to use the foldx function in conjunction with ($=) I get this error:<br>
<br><b><span style="font-family: courier new,monospace;">> :t foldr ($=)</span></b><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><interactive>:1:7:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Occurs check: cannot construct the infinite type:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> b0 = Step ao0 m0 b0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Expected type: Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -> Enumeratee ao0 ao0 m0 b0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> -> Enumeratee ao0 ao0 m0 b0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Actual type: Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> -> Enumeratee ao0 ao0 m0 b0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -> Enumerator ao0 m0 b0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> In the first argument of `foldr', namely `($=)'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> In the expression: foldr ($=)</span><br>
<br style="font-family: courier new,monospace;"><b><span style="font-family: courier new,monospace;">> :t Prelude.foldl ($=)</span></b><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><interactive>:1:15:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Occurs check: cannot construct the infinite type:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> b0 = Step ao0 m0 b0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Expected type: Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> -> Enumeratee ao0 ao0 m0 b0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -> Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Actual type: Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -> Enumeratee ao0 ao0 m0 b0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> -> Enumerator ao0 m0 b0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> In the first argument of `Prelude.foldl', namely `($=)'</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> In the expression: Prelude.foldl ($=)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><interactive>:1:15:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Occurs check: cannot construct the infinite type:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> b0 = Step ao0 m0 b0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Expected type: Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -> Enumeratee ao0 ao0 m0 b0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> -> Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Actual type: Enumerator ao0 m0 (Step ao0 m0 b0)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> -> Enumeratee ao0 ao0 m0 b0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -> Enumerator ao0 m0 b0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> In the first argument of `Prelude.foldl', namely `($=)'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> In the expression: Prelude.foldl ($=)</span><br style="font-family: courier new,monospace;">
<br>Obviously there is something I don't quite understand about the ($=) (=$) functions, how can one compose a list of enumeratees, is it even possible?<br><br>Cheers.<br><br>Roman.-<br>