Hey guys,

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:

*> :t foldr ($=)*

<interactive>:1:7:
    Occurs check: cannot construct the infinite type:
      b0 = Step ao0 m0 b0
    Expected type: Enumerator ao0 m0 (Step ao0 m0 b0)
                   -> Enumeratee ao0 ao0 m0 b0
                   -> Enumeratee ao0 ao0 m0 b0
      Actual type: Enumerator ao0 m0 (Step ao0 m0 b0)
                   -> Enumeratee ao0 ao0 m0 b0
                   -> Enumerator ao0 m0 b0
    In the first argument of `foldr', namely `($=)'
    In the expression: foldr ($=)

*> :t Prelude.foldl ($=)*

<interactive>:1:15:
    Occurs check: cannot construct the infinite type:
      b0 = Step ao0 m0 b0
    Expected type: Enumerator ao0 m0 (Step ao0 m0 b0)
                   -> Enumeratee ao0 ao0 m0 b0
                   -> Enumerator ao0 m0 (Step ao0 m0 b0)
      Actual type: Enumerator ao0 m0 (Step ao0 m0 b0)
                   -> Enumeratee ao0 ao0 m0 b0
                   -> Enumerator ao0 m0 b0
    In the first argument of `Prelude.foldl', namely `($=)'
    In the expression: Prelude.foldl ($=)

<interactive>:1:15:
    Occurs check: cannot construct the infinite type:
      b0 = Step ao0 m0 b0
    Expected type: Enumerator ao0 m0 (Step ao0 m0 b0)
                   -> Enumeratee ao0 ao0 m0 b0
                   -> Enumerator ao0 m0 (Step ao0 m0 b0)
      Actual type: Enumerator ao0 m0 (Step ao0 m0 b0)
                   -> Enumeratee ao0 ao0 m0 b0
                   -> Enumerator ao0 m0 b0
    In the first argument of `Prelude.foldl', namely `($=)'
    In the expression: Prelude.foldl ($=)

Obviously there is something I don't quite understand about the ($=) (=$)
functions, how can one compose a list of enumeratees, is it even possible?

Cheers.

Roman.-
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to