Skip to content

Commit

Permalink
Fix Ratio instance
Browse files Browse the repository at this point in the history
  • Loading branch information
UnkindPartition committed Jul 12, 2013
1 parent 68aa7e5 commit af816c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Test/SmallCheck/Series.hs
Expand Up @@ -478,7 +478,9 @@ instance Monad m => CoSerial m Double where
(. (realToFrac :: Double -> Float)) <$> coseries rs

instance (Integral i, Serial m i) => Serial m (Ratio i) where
series = uncurry (%) <$> series
series = pairToRatio <$> series
where
pairToRatio (n, Positive d) = n % d
instance (Integral i, CoSerial m i) => CoSerial m (Ratio i) where
coseries rs = (. ratioToPair) <$> coseries rs
where
Expand Down

0 comments on commit af816c4

Please sign in to comment.