Skip to content

Instantly share code, notes, and snippets.

@kindaro
Last active August 31, 2023 19:50
Show Gist options
  • Save kindaro/5af384dcf8b23d63711b67cb85d3b352 to your computer and use it in GitHub Desktop.
Save kindaro/5af384dcf8b23d63711b67cb85d3b352 to your computer and use it in GitHub Desktop.
{-# 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
module Types where
import GHC.Generics
data User = User { name :: String, age :: Int }
deriving (Show, Generic)
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