Thirst will work I think. I tested a demo and the only problem I can see is the unwieldiness of the syntax, i.e<div><br></div><div>testThirst = f `Cons` (g `Cons` (h `Cons` Nil))</div><div><br></div><div>Maybe there is a way to sugar up the syntax to get rid of the parentheses?</div>
<div><div><br><div class="gmail_quote">On Mon, Dec 28, 2009 at 7:43 PM, Antoine Latter <span dir="ltr">&lt;<a href="mailto:aslatter@gmail.com" target="_blank">aslatter@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div></div><div>On Mon, Dec 28, 2009 at 10:32 PM, Jonathan Fischoff<br>
&lt;<a href="mailto:jonathangfischoff@gmail.com" target="_blank">jonathangfischoff@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt; I would to create a list of tuples (or something similar) of invertible<br>
&gt; functions<br>
&gt; [((a -&gt; b), (b -&gt; a)), ((b -&gt; c), (c -&gt; b)), ....<br>
&gt; Such that I could call<br>
&gt; forward invertibleFuctionList domainValue = ? -- composite all the functions<br>
&gt; backward invertibleFuctionList rangeValue =<br>
&gt;     forward (reverse invertibleFuctionList) rangeValue  -- or something<br>
&gt; similar<br>
&gt;<br>
&gt; I would also like to concat them. This sounds like a job for GADT that<br>
&gt; someone might have already tackled. Any ideas?<br>
<br>
</div></div><div><div></div><div>It looks like the thrist package should help you out:<br>
<br>
<a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/thrist" target="_blank">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/thrist</a><br>
<br>
You could define some sort of type Iso:<br>
<br>
data Iso a b = Iso (a -&gt; b) (b -&gt; a)<br>
<br>
And then build a Thrist and fold over it, the functions forward and<br>
backwards can both be implemented with right-folds.<br>
</div></div></blockquote></div><br>
</div></div>