Skip to content

Commit

Permalink
add COMPLETE pragma for CellDouble view pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
olafklinke authored Jun 3, 2024
1 parent 6c9ddcb commit e4712f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Codec/Xlsx/Types/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ data CellValue
| CellRich [RichTextRun]
| CellError ErrorType
deriving (Eq, Ord, Show, Generic)
{-# COMPLETE CellText, CellDecimal, CellBool, CellRich, CellError #-}

viewCellDouble :: CellValue -> Maybe Double
viewCellDouble (CellDecimal s) = Just (toRealFloat s)
Expand All @@ -428,6 +429,7 @@ viewCellDouble _ = Nothing
-- view pattern, since 'CellDecimal' has replaced the old constructor.
pattern CellDouble :: Double -> CellValue
pattern CellDouble b <- (viewCellDouble -> Just b)
{-# COMPLETE CellText, CellDouble, CellBool, CellRich, CellError #-}

instance NFData CellValue

Expand Down

0 comments on commit e4712f4

Please sign in to comment.