Remove generic and flat instances

This commit is contained in:
2022-08-21 22:38:40 +01:00
parent 36c8befa9f
commit 7181046aa3
94 changed files with 312 additions and 423 deletions
+8 -6
View File
@@ -8,15 +8,16 @@ module MaybeHelp where
import Control.Lens
import Data.Aeson
import Flat
import Data.Aeson.TH
data Maybe' a = Just' {__Just' :: a} | Nothing'
deriving (Eq, Ord, Show, Read, Generic, Flat)
--deriving (Eq, Ord, Show, Read, Generic) --Generic, Flat)
deriving (Eq, Ord, Show, Read) --Generic, Flat)
instance ToJSON a => ToJSON (Maybe' a) where
toEncoding = genericToEncoding defaultOptions
instance FromJSON a => FromJSON (Maybe' a)
--instance ToJSON a => ToJSON (Maybe' a) where
-- toEncoding = genericToEncoding defaultOptions
--
--instance FromJSON a => FromJSON (Maybe' a)
fromJust' :: Maybe' a -> a
fromJust' mx = case mx of
@@ -40,3 +41,4 @@ toggleJust Nothing = Just ()
toggleJust _ = Nothing
makeLenses ''Maybe'
deriveJSON defaultOptions ''Maybe'