{-# language BlockArguments #-} import Data.Functor.Identity -- This is the worst of both worlds for LOL. Don't do this. :) data E = forall a. E a (a -> String) foo :: Int -> E foo n | even n = E (show n) id | otherwise = E n show bar' :: Int -> String bar' n | E x1 f1 <- foo n , E x2 f2 <- foo (n+1) = f1 x1 ++ f2 x2 main :: IO () main = putStrLn (bar' 42)