Move Post to its own module
This commit is contained in:
parent
5a14a1849a
commit
b6ca8364a4
|
@ -1,24 +1,9 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module Main where
|
||||
|
||||
import Control.Applicative
|
||||
import Data.Monoid
|
||||
import Data.Text hiding (head)
|
||||
import Database.SQLite.Simple
|
||||
import Database.SQLite.Simple.FromRow
|
||||
import Web.Spock.Safe hiding (head)
|
||||
|
||||
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
|
||||
import Within.DBMemorial.Post
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue