.

1
2
3
4
5
6
7
8
9
10
class LayoutClass l a where
  layout :: l a -> ()

liftLayout :: (LayoutClass m a) => (forall l. l a -> m a) -> Layout a -> Layout a
liftLayout f (Layout l) = Layout (f l)

data Layout a where
  Layout :: forall a l. (LayoutClass l a) => (l a) -> Layout a

-- omitted Read for simplicity