partialApplySub :: (QItem, QItem) -> QItem -> QItem
partialApplySub (from, to) (QQuote p b) = QQuote (fmap no_rec_sub p) (fmap (partialApplySub (from, to)) b)
  where no_rec_sub x = if x == from then to else x
partialApplySub :: (QItem, QItem) -> QItem -> QItem
partialApplySub (from, to) (QQuote p b) = QQuote (fmap no_rec_sub p) (fmap (partialApplySub (from, to)) b)
  where no_rec_sub x = if x == from then to else x
partialApplySub (from, to) (QQuote p b) = QQuote (fmap no_rec_sub p) (fmap (partialApplySub (from, to)) b)
  where no_rec_sub x = if x == from then to else x