fftCore :: Data Index -> Pull1 (Complex Float) -> Pull1 (Complex Float)
fftCore n = composeOn stage (reverse (0...n))
  where
    stage k vec = indexed1 (length vec) ixf
      where
        ixf i = condition (testBit i k) (twid * (b - a)) (a+b)
          where
            a    = vec !! i
            b    = vec !! (i `xor` k2)
            twid = cis (-pi * i2f (lsbs k i) / i2f k2)
            k2   = 1 .<<. k
fftCore :: Data Index -> Pull1 (Complex Float) -> Pull1 (Complex Float)
fftCore n = composeOn stage (reverse (0...n))
  where
    stage k vec = indexed1 (length vec) ixf
      where
        ixf i = condition (testBit i k) (twid * (b - a)) (a+b)
          where
            a    = vec !! i
            b    = vec !! (i `xor` k2)
            twid = cis (-pi * i2f (lsbs k i) / i2f k2)
            k2   = 1 .<<. k
fftCore n = composeOn stage (reverse (0...n))
  where
    stage k vec = indexed1 (length vec) ixf
      where
        ixf i = condition (testBit i k) (twid * (b - a)) (a+b)
          where
            a    = vec !! i
            b    = vec !! (i `xor` k2)
            twid = cis (-pi * i2f (lsbs k i) / i2f k2)
            k2   = 1 .<<. k