diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e0257d52..c85c70ae 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -27,7 +27,9 @@ jobs: - os: ubuntu-latest stack-yaml: stack-lts-17.yaml extra-args: "" - + - os: ubuntu-latest + stack-yaml: stack-nightly.yaml + extra-args: "" steps: - name: Clone project uses: actions/checkout@v2 diff --git a/src/Codec/Xlsx/Formatted.hs b/src/Codec/Xlsx/Formatted.hs index c1b21715..9d39fc36 100644 --- a/src/Codec/Xlsx/Formatted.hs +++ b/src/Codec/Xlsx/Formatted.hs @@ -340,7 +340,7 @@ formatCell (row, col) cell = do mapM go block where go :: ((Int, Int), FormattedCell) -> State FormattingState ((Int, Int), Cell) - go (pos, c@ FormattedCell{..}) = do + go (pos, c@FormattedCell{..}) = do styleId <- cellStyleId c return (pos, _formattedCell{_cellStyle = styleId}) diff --git a/src/Codec/Xlsx/Lens.hs b/src/Codec/Xlsx/Lens.hs index 67e8bcb0..f15f6912 100644 --- a/src/Codec/Xlsx/Lens.hs +++ b/src/Codec/Xlsx/Lens.hs @@ -84,7 +84,7 @@ ixCellRC i = wsCells . ix i -- | lens to access cell in a worksheet using more traditional -- x+y coordinates ixCellXY :: (Int, Int) -> Traversal' Worksheet Cell -ixCellXY = ixCellRC . swap +ixCellXY i = ixCellRC $ swap i -- | accessor that can read, write or delete cell in a worksheet -- synonym of 'atCellRC' so uses row+column index @@ -98,7 +98,7 @@ atCellRC i = wsCells . at i -- | lens to read, write or delete cell in a worksheet -- using more traditional x+y or row+column index atCellXY :: (Int, Int) -> Lens' Worksheet (Maybe Cell) -atCellXY = atCellRC . swap +atCellXY i = atCellRC $ swap i -- | lens to read, write or delete cell value in a worksheet -- with row+column coordinates, synonym for 'cellValueRC' @@ -113,4 +113,4 @@ cellValueAtRC i = atCell i . non def . cellValue -- | lens to read, write or delete cell value in a worksheet -- using traditional x+y coordinates cellValueAtXY :: (Int, Int) -> Lens' Worksheet (Maybe CellValue) -cellValueAtXY = cellValueAtRC . swap +cellValueAtXY i = cellValueAtRC $ swap i diff --git a/src/Codec/Xlsx/Types/Drawing.hs b/src/Codec/Xlsx/Types/Drawing.hs index 9e42ae8e..1452edf0 100644 --- a/src/Codec/Xlsx/Types/Drawing.hs +++ b/src/Codec/Xlsx/Types/Drawing.hs @@ -217,6 +217,21 @@ data Anchor p g = Anchor } deriving (Eq, Show, Generic) instance (NFData p, NFData g) => NFData (Anchor p g) +data GenericDrawing p g = Drawing + { _xdrAnchors :: [Anchor p g] + } deriving (Eq, Show, Generic) +instance (NFData p, NFData g) => NFData (GenericDrawing p g) + +-- See 20.5.2.35 "wsDr (Worksheet Drawing)" (p. 3176) +type Drawing = GenericDrawing FileInfo ChartSpace + +type UnresolvedDrawing = GenericDrawing RefId RefId + +makeLenses ''Anchor +makeLenses ''DrawingObject +makeLenses ''BlipFillProperties +makeLenses ''GenericDrawing + -- | simple drawing object anchoring using one cell as a top lelft -- corner and dimensions of that object simpleAnchorXY :: (Int, Int) -- ^ x+y coordinates of a cell used as @@ -233,21 +248,6 @@ simpleAnchorXY (x, y) sz obj = , _anchClientData = def } -data GenericDrawing p g = Drawing - { _xdrAnchors :: [Anchor p g] - } deriving (Eq, Show, Generic) -instance (NFData p, NFData g) => NFData (GenericDrawing p g) - --- See 20.5.2.35 "wsDr (Worksheet Drawing)" (p. 3176) -type Drawing = GenericDrawing FileInfo ChartSpace - -type UnresolvedDrawing = GenericDrawing RefId RefId - -makeLenses ''Anchor -makeLenses ''DrawingObject -makeLenses ''BlipFillProperties -makeLenses ''GenericDrawing - {------------------------------------------------------------------------------- Default instances -------------------------------------------------------------------------------} diff --git a/stack-nightly.yaml b/stack-nightly.yaml index 8dba7f85..130b7172 100644 --- a/stack-nightly.yaml +++ b/stack-nightly.yaml @@ -1,3 +1,3 @@ -resolver: nightly-2019-10-31 +resolver: nightly-2021-06-19 packages: - '.' diff --git a/xlsx.cabal b/xlsx.cabal index c52c7d7a..98e972c3 100644 --- a/xlsx.cabal +++ b/xlsx.cabal @@ -26,7 +26,7 @@ Maintainer: qrilka@gmail.com Category: Codec Build-type: Simple -Tested-with: GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.4 +Tested-with: GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.4, GHC == 9.0.1 Cabal-version: >=1.10 Flag microlens