summaryrefslogtreecommitdiffstats
path: root/Regfish/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Regfish/Types.hs')
-rw-r--r--Regfish/Types.hs15
1 files changed, 11 insertions, 4 deletions
diff --git a/Regfish/Types.hs b/Regfish/Types.hs
index 734c6c3..23a4c30 100644
--- a/Regfish/Types.hs
+++ b/Regfish/Types.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
@@ -10,14 +9,22 @@ import Control.Lens
import Control.Monad.Reader
import Control.Monad.State
import qualified Data.ByteString.Char8 as BS8
-import Data.SafeCopy (base, deriveSafeCopy)
+import Data.SafeCopy (SafeCopy, base, contain, deriveSafeCopy, getCopy, putCopy, safeGet, safePut, version)
import Data.Typeable
import qualified Network.HTTP.Client as C
import qualified Network.Wreq as W
-deriveSafeCopy 0 'base ''C.CookieJar
-deriveSafeCopy 0 'base ''W.Cookie
+instance SafeCopy W.Cookie where
+ version = 1
+ putCopy = contain . safePut . show
+ getCopy = contain $ read <$> safeGet
+
+
+instance SafeCopy C.CookieJar where
+ version = 1
+ putCopy = contain . safePut . show
+ getCopy = contain $ read <$> safeGet
newtype Regfish a = Regfish