-- reduces a quark item to a less complex but semantically equivalent version
optimize :: QItem -> QItem
optimize x = if x == x' then x else optimize x'
  where opts = recQProgOpt partialApply_O . recQProgOpt redundantCall_O
        x' = opts x
optimize :: QItem -> QItem
optimize x = if x == x' then x else optimize x'
  where opts = recQProgOpt partialApply_O . recQProgOpt redundantCall_O
        x' = opts x
optimize x = if x == x' then x else optimize x'
  where opts = recQProgOpt partialApply_O . recQProgOpt redundantCall_O
        x' = opts x