§ Practical example of semidirect product


-- | represents a string with indexes into it.
type IndexedString = (String , [Nat])


instance Semigroup IndexedString where
  (IndexedString s1 ixs1) <> (IndexedString s2 ixs2) =
    (s1 <> s2, ix1 <> ((+) (length s1)) <$>  ixs2)