{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes       #-}

module Compos where

import Base
import HFunctor

compos :: (Ix s ix, HFunctor (PF s)) =>
          (forall ix. Ix s ix => s ix -> ix -> ix) -> ix -> ix
compos f = to . hmap (\ ix -> I0 . f ix . unI0) . from

