time-wasting-thread-memorial/web/src/Within/DBMemorial/Post.hs

20 lines
565 B
Haskell
Raw Normal View History

2015-07-28 06:18:58 +00:00
{-# LANGUAGE OverloadedStrings #-}
module Within.DBMemorial.Post where
2015-07-28 07:00:18 +00:00
import Control.Applicative
import Data.Monoid ()
import Data.Text
import Database.SQLite.Simple.FromRow
2015-07-28 06:18:58 +00:00
2015-07-28 06:47:39 +00:00
data Post = Post
{ id :: Int
, oID :: Text
, body :: Text
, markdown :: Text
, author :: Text
, page :: Int
2015-07-28 06:47:39 +00:00
} deriving (Show, Eq)
2015-07-28 06:18:58 +00:00
instance FromRow Post where
fromRow = Post <$> field <*> field <*> field <*> field <*> field <*> field