diff --git a/lib/Text/Encyclopedia/Article.hs b/lib/Text/Encyclopedia/Article.hs index 116eba0e840bab456eac7875287da9873bc88c80..4a9b5bd3a30eeb4a3a4bf88d80cd4dc57bd46e65 100644 --- a/lib/Text/Encyclopedia/Article.hs +++ b/lib/Text/Encyclopedia/Article.hs @@ -2,6 +2,8 @@ module Text.Encyclopedia.Article ( Article(..) , InflectedPOS(..) + , Inflection(..) + , POS(..) , article , headwords_ , inflectedPOS_ @@ -18,19 +20,19 @@ import Data.Char (isLower, isPunctuation, isSpace, isUpper, toLower) import Data.Text as Text (Text, append, isPrefixOf, length, map, pack, splitAt, unpack) import Text.Printf (printf) -data POS = Adj | Substantive | Verb deriving (Bounded, Enum, Show) -data Inflection = Masculine | Feminine deriving (Bounded, Enum, Show) +data POS = Adjective | Substantive | Verb deriving (Bounded, Enum, Eq, Show) +data Inflection = Masculine | Feminine deriving (Bounded, Enum, Eq, Show) data InflectedPOS = InflectedPOS { pos :: POS , inflection :: Maybe Inflection - } deriving Show + } deriving (Eq, Show) data Article = Article { headwords :: [String] , inflectedPOS :: Maybe InflectedPOS , body :: Text - } deriving Show + } deriving (Eq, Show) article :: Parser Article article = Article <$> headwords_ <*> optional inflectedPOS_ <*> body_