Inversion
    :: (Num t, G.Vector v t)
    => Proxy v
    -> (Word -> t)
    -> Word
    -> t
generalInversion proxy fun n = case n of
    0 ->error "Möbius inversion only defined on positive domain"
    1 -> fun 1
    2 -> fun 2 - fun 1
    3 -> fun 3 - 2*fun 1
    _ -> runST (fastInvertST proxy (fun . intToWord) (wordToInt n))

fastIn
generalInversion
    :: (Num t, G.Vector v t)
    => Proxy v
    -> (Word -> t)
    -> Word
    -> t
generalInversion proxy fun n = case n of
    0 ->error "Möbius inversion only defined on positive domain"
    1 -> fun 1
    2 -> fun 2 - fun 1
    3 -> fun 3 - 2*fun 1
    _ -> runST (fastInvertST proxy (fun . intToWord) (wordToInt n))
generalInversion proxy fun n = case n of
    0 ->error "Möbius inversion only defined on positive domain"
    1 -> fun 1
    2 -> fun 2 - fun 1
    3 -> fun 3 - 2*fun 1
    _ -> runST (fastInvertST proxy (fun . intToWord) (wordToInt n))