Answer the question
In order to leave comments, you need to log in
Haskell program, how to output structure data?
Data structure: country; reserve; number of species of rare animals in the reserve. Create two queries that allow you to display the list "Country - number of reserves" and a list of those reserves where the most rare species are.
Tell me how to display the list Country - number of reserves
Structure example
i1 = Reserves {
country = "Russia",
reserve = "RoevRuchey",
animalsCount = 8056
}
Answer the question
In order to leave comments, you need to log in
Let's say we have a structure:
data Struct = Constructor {
field :: String,
value :: Integer
}
deriving (Show)
Prelude> let item = Constructor "Module" 100
Prelude> field s
"Module"
Prelude>value s
100
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question