Last active
August 31, 2023 19:50
-
-
Save kindaro/5af384dcf8b23d63711b67cb85d3b352 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DerivingStrategies #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module DB where | |
import Data.Aeson | |
import GHC.Generics | |
import Types (User) | |
newtype UserDB = UserDB User deriving newtype Generic deriving stock Show | |
instance ToJSON UserDB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Types where | |
import GHC.Generics | |
data User = User { name :: String, age :: Int } | |
deriving (Show, Generic) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cabal-version: 3.0 | |
name: x | |
version: 0 | |
library | |
build-depends: base, aeson | |
exposed-modules: Types DB | |
default-language: GHC2021 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment