type chaning syb transform - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Jan van Brügge

Does anybody know if it is possible to transform the type of a datatype with syb?
If I have a datatype like

data Foo a = Foo { field1 :: Bool, field2 :: a }

Can I write an syb transform like this?

transform :: Foo Pandoc -> IO (Foo Text)
transform = everywhere $ _ renderPandoc
Jan van Brügge

I am stupid, just derive Functor, Foldable and Traversable and the function becomes traverse renderPandoc

Jan van Brügge

God how I love this language

Jan van Brügge

This is very much an improvement