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"><<a href="mailto:aslatter@gmail.com" target="_blank">aslatter@gmail.com</a>></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>
<<a href="mailto:jonathangfischoff@gmail.com" target="_blank">jonathangfischoff@gmail.com</a>> wrote:<br>
> Hi,<br>
> I would to create a list of tuples (or something similar) of invertible<br>
> functions<br>
> [((a -> b), (b -> a)), ((b -> c), (c -> b)), ....<br>
> Such that I could call<br>
> forward invertibleFuctionList domainValue = ? -- composite all the functions<br>
> backward invertibleFuctionList rangeValue =<br>
> forward (reverse invertibleFuctionList) rangeValue -- or something<br>
> similar<br>
><br>
> I would also like to concat them. This sounds like a job for GADT that<br>
> 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 -> b) (b -> 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>