Kulitta-2.2.1: Library for automated composition and musical learning

Safe HaskellSafe
LanguageHaskell98

Kulitta.PTGG

Documentation

data Term a b Source #

Constructors

NT (a, b) 
Let String (Sentence a b) (Sentence a b) 
Var String 
Instances
(Eq a, Eq b) => Eq (Term a b) Source # 
Instance details

Defined in Kulitta.PTGG

Methods

(==) :: Term a b -> Term a b -> Bool #

(/=) :: Term a b -> Term a b -> Bool #

(Show a, Show b) => Show (Term a b) Source # 
Instance details

Defined in Kulitta.PTGG

Methods

showsPrec :: Int -> Term a b -> ShowS #

show :: Term a b -> String #

showList :: [Term a b] -> ShowS #

type Sentence a b = [Term a b] Source #

data Rule a b Source #

Constructors

(a, Prob) :-> (RuleFun a b) 

type RuleFun a b = b -> Sentence a b Source #

update :: (Eq a, Eq b) => [Rule a b] -> (StdGen, Sentence a b) -> (StdGen, Sentence a b) Source #

applyRule :: Eq a => [Rule a b] -> StdGen -> (a, b) -> (StdGen, Sentence a b) Source #

gen :: (Eq a, Eq b) => [Rule a b] -> (StdGen, Sentence a b) -> [(StdGen, Sentence a b)] Source #

expand :: [(String, Sentence a b)] -> Sentence a b -> Sentence a b Source #

tMap :: ((a, b) -> (c, d)) -> Sentence a b -> Sentence c d Source #

toPairs :: Sentence a b -> [(a, b)] Source #

updateProbs :: [Rule a b] -> [Prob] -> [Rule a b] Source #

lhs :: Rule a b -> a Source #

prob :: Rule a b -> Prob Source #

rfun :: Rule a b -> RuleFun a b Source #

normalize :: Eq a => [Rule a b] -> [Rule a b] Source #