回到我的动物示例:
type Pig = String
type Lion = String
type Feed = [(Char,Char)]
type Visitors = [(Char,Char)]
type Costs = (Int,Int,Int)
data AnimalHome = Farm Pig Pig Pig Feed | Zoo Lion Lion Lion Feed Visitors
orders :: Char -> AnimalHome -> Costs -> Char
orders stuff Farm p1 p2 p3 feed (cost1,cost2,cost3) = some code here
我将如何执行不同的方程式?假设 p1 p2 p3 输入为“Bert”“Donald”“Horace”,我希望它执行一个特定的方程,但如果它们输入为“Bert”“Donald”“Sheila”,我希望它执行一个不同的方程方程?