summaryrefslogtreecommitdiff
path: root/lib/Patat/Images/Internal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Patat/Images/Internal.hs')
-rw-r--r--lib/Patat/Images/Internal.hs40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/Patat/Images/Internal.hs b/lib/Patat/Images/Internal.hs
new file mode 100644
index 0000000..246fb44
--- /dev/null
+++ b/lib/Patat/Images/Internal.hs
@@ -0,0 +1,40 @@
+--------------------------------------------------------------------------------
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE ExistentialQuantification #-}
+module Patat.Images.Internal
+ ( Config (..)
+ , Backend (..)
+ , BackendNotSupported (..)
+ , Handle (..)
+ ) where
+
+
+--------------------------------------------------------------------------------
+import Control.Exception (Exception)
+import qualified Data.Aeson as A
+import Data.Data (Data)
+import Data.Typeable (Typeable)
+import Patat.Cleanup
+
+
+--------------------------------------------------------------------------------
+data Config a = Auto | Explicit a deriving (Eq)
+
+
+--------------------------------------------------------------------------------
+data Backend = forall a. A.FromJSON a => Backend (Config a -> IO Handle)
+
+
+--------------------------------------------------------------------------------
+data BackendNotSupported = BackendNotSupported String
+ deriving (Data, Show, Typeable)
+
+
+--------------------------------------------------------------------------------
+instance Exception BackendNotSupported
+
+
+--------------------------------------------------------------------------------
+data Handle = Handle
+ { hDrawImage :: FilePath -> IO Cleanup
+ }