-- given an item set and a start item it returns a sequence of all the individual
-- items in the set
expandItemSet :: ItemSet -> Item -> S.Seq ItemSet
expandItemSet v p
    | p > v = S.empty
    | v .&. p /= 0 = p S.<| expandItemSet v (p `unsafeShiftL` 1)
    | otherwise = expandItemSet v (p `unsafeShiftL` 1)
expandItemSet :: ItemSet -> Item -> S.Seq ItemSet
expandItemSet v p
    | p > v = S.empty
    | v .&. p /= 0 = p S.<| expandItemSet v (p `unsafeShiftL` 1)
    | otherwise = expandItemSet v (p `unsafeShiftL` 1)
expandItemSet v p
    | p > v = S.empty
    | v .&. p /= 0 = p S.<| expandItemSet v (p `unsafeShiftL` 1)
    | otherwise = expandItemSet v (p `unsafeShiftL` 1)