aticPrime a b c p
  | a `rem` p' == 0
  = solveLinear' p' b c
  | otherwise
  = map (\n -> (n - b) * recipModInteger (2 * a) p' `mod` p')
  $ sqrtsModPrime (b * b - 4 * a * c) p
    where
      p' :: Integer
      p' = unPrime p

solveQuadraticPrime a b c p
  | a `rem` p' == 0
  = solveLinear' p' b c
  | otherwise
  = map (\n -> (n - b) * recipModInteger (2 * a) p' `mod` p')
  $ sqrtsModPrime (b * b - 4 * a * c) p
    where
      p' :: Integer
      p' = unPrime p
solveQuadraticPrime a b c p
  | a `rem` p' == 0
  = solveLinear' p' b c
  | otherwise
  = map (\n -> (n - b) * recipModInteger (2 * a) p' `mod` p')
  $ sqrtsModPrime (b * b - 4 * a * c) p
    where
      p' :: Integer
      p' = unPrime p