[Haskell-cafe] Invertible functions list

Eugene Kirpichov ekirpichov at gmail.com
Tue Dec 29 10:45:09 EST 2009


forward Id a = a
forward (ICons f _ r) a = forward r (f a)

backward Id a = a
backward (ICons _ f r) a = f (backward r a)

2009/12/29 Eugene Kirpichov <ekirpichov at gmail.com>:
> data IList a b where
>    Id :: IList a a
>    ICons :: (a -> b) -> (b -> a) -> IList b c -> IList a c
>
> 2009/12/29 Jonathan Fischoff <jonathangfischoff at gmail.com>:
>> This seems like exactly what I want, but there are two problems: I can't
>> access the paper and it requires Generic Haskell. I'm just too much of newb
>> to jump into generic Haskell :).
>>
>> On Mon, Dec 28, 2009 at 7:41 PM, Dan Weston <westondan at imageworks.com>
>> wrote:
>>>
>>> This might be pertinent:
>>>
>>> Alimarine et al, "There and Back Again: Arrows for Invertible Programming"
>>> http://www.cs.ru.nl/A.vanWeelden/bi-arrows/
>>>
>>> Jonathan Fischoff wrote:
>>>>
>>>> Hi,
>>>> I would to create a list of tuples (or something similar) of invertible
>>>> functions
>>>>
>>>> [((a -> b), (b -> a)), ((b -> c), (c -> b)), ....
>>>>
>>>> Such that I could call
>>>>
>>>> forward invertibleFuctionList domainValue = ? -- composite all the
>>>> functions
>>>> backward invertibleFuctionList rangeValue =    forward (reverse
>>>> invertibleFuctionList) rangeValue  -- or something similar
>>>>
>>>>
>>>> I would also like to concat them. This sounds like a job for GADT that
>>>> someone might have already tackled. Any ideas?
>>>>
>>>> -Jonathan
>>>>
>>>
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>
>
>
> --
> Eugene Kirpichov
> Web IR developer, market.yandex.ru
>



-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru


More information about the Haskell-Cafe mailing list