Skip to content

Commit

Permalink
Omit fromList in Show/Read instances
Browse files Browse the repository at this point in the history
Fixes #14.
  • Loading branch information
tibbe committed Apr 7, 2014
1 parent 4f924ea commit fa96a33
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Data/Vector/Generic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2053,13 +2053,12 @@ cmp xs ys = compare (stream xs) (stream ys)
-- | Generic definition of 'Prelude.showsPrec'
showsPrec :: (Vector v a, Show a) => Int -> v a -> ShowS
{-# INLINE showsPrec #-}
showsPrec p v = showParen (p > 10) $ showString "fromList " . shows (toList v)
showsPrec _ = shows . toList

-- | Generic definition of 'Text.Read.readPrec'
readPrec :: (Vector v a, Read a) => Read.ReadPrec (v a)
{-# INLINE readPrec #-}
readPrec = Read.parens $ Read.prec 10 $ do
Read.Ident "fromList" <- Read.lexP
readPrec = do
xs <- Read.readPrec
return (fromList xs)

Expand Down

0 comments on commit fa96a33

Please sign in to comment.