
Hi, Am Donnerstag, den 03.12.2009, 10:22 -0800 schrieb yairchu@gmail.com:
I guess TH could probably do this.
I think this does what you wish for: http://hackage.haskell.org/packages/archive/peakachu/0.2/doc/html/Data-Newty...
Example:
$(mkWithNewtypeFuncs [2] ''ZipList) withZipList2 (<*>) [(+3), (*3)] [6, 7] [9, 21] $(mkInNewtypeFuncs [2] ''ZipList) getZipList $ inZipList2 (++) (ZipList "hello ") (ZipList "world") "hello world"
in some future this won't be in this unrelated "peakachu" package, and be incorporated into Neil M's derive. but for now this is where you can find it.
Nice, and close. It seems it does not handle the datatype in arbitrary positions in the type (as in Foo -> ( a -> Either Foo ())) -> (Foo, ())). But thanks for the pointer. Maybe I should give it a shot. Greetings, Joachim -- Joachim Breitner e-Mail: mail@joachim-breitner.de Homepage: http://www.joachim-breitner.de ICQ#: 74513189 Jabber-ID: nomeata@joachim-breitner.de