Skip to content

Instantly share code, notes, and snippets.

@saevarb
Created February 14, 2018 20:53
Show Gist options
  • Save saevarb/777b07cca49a1b5298c227d01f095643 to your computer and use it in GitHub Desktop.
Save saevarb/777b07cca49a1b5298c227d01f095643 to your computer and use it in GitHub Desktop.
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Proxy
data UTCTime
data ID a
data GenTable a
data Connection
-- class DbSerializable a where
-- type RowType a
-- table :: GenTable a
class Repository entity where
type NewEntity entity
type RowType entity
makeNewRow :: Proxy entity -> NewEntity entity -> UTCTime -> RowType entity
makeRow :: entity -> UTCTime -> RowType entity
litteral :: entity -> RowType entity
idPredicate :: (ID entity) -> RowType entity -> Bool
table :: GenTable entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment