Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
fail-fast: false
matrix:
ghc:
- '9.12'
- '9.10'
- '9.8'
- '9.6'
Expand All @@ -27,15 +28,15 @@ jobs:
- '8.6'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}

- name: Restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cache
with:
path: ${{ steps.setup.outputs.cabal-store }}
Expand All @@ -44,11 +45,12 @@ jobs:
${{ runner.os }}-build-${{ matrix.ghc }}-

- name: Install dependencies
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
run: |
cabal build --project-file=cabal_no_viewer.project --only-dependencies --enable-tests --enable-benchmarks all

- name: Save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
Expand Down
7 changes: 2 additions & 5 deletions core/lib/Pdf/Core/Exception.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE DeriveDataTypeable #-}

-- | Exceptions and utilities
module Pdf.Core.Exception
(
Expand All @@ -10,20 +8,19 @@ module Pdf.Core.Exception
)
where

import Data.Typeable
import Control.Exception hiding (throw)

-- | File is corrupted
--
-- Contains general message and a list of details
data Corrupted = Corrupted String [String]
deriving (Show, Typeable)
deriving (Show)

instance Exception Corrupted where

-- | Something unexpected occurs, probably API missuse
data Unexpected = Unexpected String [String]
deriving (Show, Typeable)
deriving (Show)

instance Exception Unexpected where

Expand Down
4 changes: 1 addition & 3 deletions core/lib/Pdf/Core/XRef.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}

-- | Cross reference

Expand Down Expand Up @@ -27,7 +26,6 @@ import Pdf.Core.Util
import Pdf.Core.IO.Buffer (Buffer)
import qualified Pdf.Core.IO.Buffer as Buffer

import Data.Typeable
import Data.Int
import Data.ByteString (ByteString)
import qualified Data.ByteString as ByteString
Expand Down Expand Up @@ -250,6 +248,6 @@ lookupStreamEntry dict is (R objNumber _) =

-- | Unknown entry type should be interpreted as reference to null object
data UnknownXRefStreamEntryType = UnknownXRefStreamEntryType Int
deriving (Show, Typeable)
deriving (Show)

instance Exception UnknownXRefStreamEntryType
4 changes: 1 addition & 3 deletions document/lib/Pdf/Document/Pdf.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}

module Pdf.Document.Pdf
Expand Down Expand Up @@ -30,7 +29,6 @@ import Pdf.Core.Encryption (defaultUserPassword)

import Pdf.Document.Internal.Types

import Data.Typeable
import Data.IORef
import Data.ByteString (ByteString)
import Data.Text (Text)
Expand Down Expand Up @@ -141,6 +139,6 @@ deref _ o = return o

-- | File is enctypted
data EncryptedError = EncryptedError Text
deriving (Show, Typeable)
deriving (Show)

instance Exception EncryptedError
Loading