Many thanks to Sam Yonn, the link he provided had the correct formula
Used formula:
The nth digit x / y is the first digit (10 ^ (n-1) * x mod y) / y = floor (10 * (10 ^ (n-1) * x mod y) / y) mod 10
The final code looked like this:
nDigRat :: Int -> Int -> Int -> Int nDigRat num denom n = floor (fromIntegral (10*(10^(n-1)*num `rem` denom)) / fromIntegral denom) `rem` 10 decExpansionRecipRat :: Int -> [Int] decExpansionRecipRat n = map (nDigRat 1 n) [1..]
source share