{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Brassica.Paradigm.Types where
import Data.String (IsString)
data Process
= Prefix Int String
| Suffix Int String
deriving (Int -> Process -> ShowS
[Process] -> ShowS
Process -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Process] -> ShowS
$cshowList :: [Process] -> ShowS
show :: Process -> String
$cshow :: Process -> String
showsPrec :: Int -> Process -> ShowS
$cshowsPrec :: Int -> Process -> ShowS
Show, Process -> Process -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Process -> Process -> Bool
$c/= :: Process -> Process -> Bool
== :: Process -> Process -> Bool
$c== :: Process -> Process -> Bool
Eq)
type Affix = [Process]
data Grammeme = Concrete Affix | Abstract AbstractGrammeme
deriving (Int -> Grammeme -> ShowS
[Grammeme] -> ShowS
Grammeme -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Grammeme] -> ShowS
$cshowList :: [Grammeme] -> ShowS
show :: Grammeme -> String
$cshow :: Grammeme -> String
showsPrec :: Int -> Grammeme -> ShowS
$cshowsPrec :: Int -> Grammeme -> ShowS
Show, Grammeme -> Grammeme -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Grammeme -> Grammeme -> Bool
$c/= :: Grammeme -> Grammeme -> Bool
== :: Grammeme -> Grammeme -> Bool
$c== :: Grammeme -> Grammeme -> Bool
Eq)
newtype AbstractGrammeme = AbstractGrammeme String
deriving stock (Int -> AbstractGrammeme -> ShowS
[AbstractGrammeme] -> ShowS
AbstractGrammeme -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AbstractGrammeme] -> ShowS
$cshowList :: [AbstractGrammeme] -> ShowS
show :: AbstractGrammeme -> String
$cshow :: AbstractGrammeme -> String
showsPrec :: Int -> AbstractGrammeme -> ShowS
$cshowsPrec :: Int -> AbstractGrammeme -> ShowS
Show, AbstractGrammeme -> AbstractGrammeme -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AbstractGrammeme -> AbstractGrammeme -> Bool
$c/= :: AbstractGrammeme -> AbstractGrammeme -> Bool
== :: AbstractGrammeme -> AbstractGrammeme -> Bool
$c== :: AbstractGrammeme -> AbstractGrammeme -> Bool
Eq)
deriving newtype (String -> AbstractGrammeme
forall a. (String -> a) -> IsString a
fromString :: String -> AbstractGrammeme
$cfromString :: String -> AbstractGrammeme
IsString)
data Condition
= Always
| Is FeatureName Grammeme
| Not FeatureName Grammeme
deriving (Int -> Condition -> ShowS
[Condition] -> ShowS
Condition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Condition] -> ShowS
$cshowList :: [Condition] -> ShowS
show :: Condition -> String
$cshow :: Condition -> String
showsPrec :: Int -> Condition -> ShowS
$cshowsPrec :: Int -> Condition -> ShowS
Show, Condition -> Condition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Condition -> Condition -> Bool
$c/= :: Condition -> Condition -> Bool
== :: Condition -> Condition -> Bool
$c== :: Condition -> Condition -> Bool
Eq)
data Feature = Feature Condition (Maybe FeatureName) [Grammeme]
deriving (Int -> Feature -> ShowS
[Feature] -> ShowS
Feature -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Feature] -> ShowS
$cshowList :: [Feature] -> ShowS
show :: Feature -> String
$cshow :: Feature -> String
showsPrec :: Int -> Feature -> ShowS
$cshowsPrec :: Int -> Feature -> ShowS
Show, Feature -> Feature -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Feature -> Feature -> Bool
$c/= :: Feature -> Feature -> Bool
== :: Feature -> Feature -> Bool
$c== :: Feature -> Feature -> Bool
Eq)
newtype FeatureName = FeatureName String
deriving stock (Int -> FeatureName -> ShowS
[FeatureName] -> ShowS
FeatureName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FeatureName] -> ShowS
$cshowList :: [FeatureName] -> ShowS
show :: FeatureName -> String
$cshow :: FeatureName -> String
showsPrec :: Int -> FeatureName -> ShowS
$cshowsPrec :: Int -> FeatureName -> ShowS
Show, FeatureName -> FeatureName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FeatureName -> FeatureName -> Bool
$c/= :: FeatureName -> FeatureName -> Bool
== :: FeatureName -> FeatureName -> Bool
$c== :: FeatureName -> FeatureName -> Bool
Eq)
deriving newtype (String -> FeatureName
forall a. (String -> a) -> IsString a
fromString :: String -> FeatureName
$cfromString :: String -> FeatureName
IsString)
data Statement = NewFeature Feature | NewMapping [AbstractGrammeme] Affix
deriving (Int -> Statement -> ShowS
[Statement] -> ShowS
Statement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Statement] -> ShowS
$cshowList :: [Statement] -> ShowS
show :: Statement -> String
$cshow :: Statement -> String
showsPrec :: Int -> Statement -> ShowS
$cshowsPrec :: Int -> Statement -> ShowS
Show, Statement -> Statement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Statement -> Statement -> Bool
$c/= :: Statement -> Statement -> Bool
== :: Statement -> Statement -> Bool
$c== :: Statement -> Statement -> Bool
Eq)
type Paradigm = [Statement]