Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Data/Binary/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE Trustworthy #-}

Check warning on line 10 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (8.0.2)

‘Data.Binary.Class’ is marked as Trustworthy but has been inferred as safe!

Check warning on line 10 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (8.0.2)

‘Data.Binary.Class’ is marked as Trustworthy but has been inferred as safe!

#if MIN_VERSION_base(4,10,0)
{-# LANGUAGE MultiWayIf #-}
Expand Down Expand Up @@ -491,7 +491,10 @@

instance (Binary a,Integral a) => Binary (R.Ratio a) where
put r = put (R.numerator r) <> put (R.denominator r)
get = liftM2 (R.%) get get
get = do
n <- get
d <- get
if d == 0 then fail "zero denominator" else pure (n R.% d)

instance Binary a => Binary (Complex a) where
{-# INLINE put #-}
Expand Down Expand Up @@ -855,9 +858,9 @@

#if __GLASGOW_HASKELL__ < 901
-- | @since 0.8.4.0
instance Binary a => Binary (Semigroup.Option a) where

Check warning on line 861 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of type constructor or class ‘Option’

Check warning on line 861 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of type constructor or class ‘Option’
get = fmap Semigroup.Option get

Check warning on line 862 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of data constructor ‘Option’

Check warning on line 862 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of data constructor ‘Option’
put = put . Semigroup.getOption

Check warning on line 863 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of ‘getOption’ (imported from Data.Semigroup):

Check warning on line 863 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of ‘getOption’ (imported from Data.Semigroup):
#endif

-- | @since 0.8.4.0
Expand Down
Loading