Move Post to its own module

This commit is contained in:
Christine Dodrill 2015-07-27 23:18:58 -07:00
parent 5a14a1849a
commit b6ca8364a4
2 changed files with 20 additions and 16 deletions

View File

@ -1,24 +1,9 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Main where module Main where
import Control.Applicative
import Data.Monoid
import Data.Text hiding (head)
import Database.SQLite.Simple import Database.SQLite.Simple
import Database.SQLite.Simple.FromRow
import Web.Spock.Safe hiding (head) import Web.Spock.Safe hiding (head)
import Within.DBMemorial.Post
data Post = Post {
postID :: Int
, postOID :: Text
, postBody :: Text
, postMarkdown :: Text
, postAuthor :: Text
, postPage :: Int
} deriving (Show, Eq)
instance FromRow Post where
fromRow = Post <$> field <*> field <*> field <*> field <*> field <*> field
main :: IO () main :: IO ()
main = do main = do

View File

@ -0,0 +1,19 @@
{-# LANGUAGE OverloadedStrings #-}
module Within.DBMemorial.Post where
import Control.Applicative
import Data.Monoid()
import Data.Text
import Database.SQLite.Simple.FromRow
data Post = Post {
postID :: Int
, postOID :: Text
, postBody :: Text
, postMarkdown :: Text
, postAuthor :: Text
, postPage :: Int
} deriving (Show, Eq)
instance FromRow Post where
fromRow = Post <$> field <*> field <*> field <*> field <*> field <*> field