<div dir="auto">You could always do a Coyoneda transform.<div dir="auto"><br></div><div dir="auto">data IntSetF a = IntSetF !IntSet (Int -> a)</div><div dir="auto"><br></div><div dir="auto">The Functor and Foldable instances are pretty obvious from it. Similarly with your Enumerator idea.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 5, 2018, 05:56 Johannes Waldmann <<a href="mailto:johannes.waldmann@htwk-leipzig.de">johannes.waldmann@htwk-leipzig.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<br>
<br>
Thanks for responding.<br>
Let me re-phrase the technical question: in some hypothetical<br>
<br>
>       instance Foldable Enumerator where ...<br>
<br>
the methods (e.g., foldMap) would be overconstrained.<br>
Is there a way to still write something like it?<br>
<br>
It seems not, as shown by these examples:<br>
<br>
Data.EnumSet cannot implement Foldable because of  Enum k.<br>
<a href="http://hackage.haskell.org/package/enummapset/docs/Data-EnumSet.html" rel="noreferrer noreferrer" target="_blank">http://hackage.haskell.org/package/enummapset/docs/Data-EnumSet.html</a><br>
<br>
Data.IntSet cannot implement Foldable because of   k ~ Int.<br>
<br>
- J.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>