Structs in Idris
Our first program demonstrates how to define and use structs. Structs are useful for grouping data together to form records.
This person
struct type has name
and age
fields.
To run the program, save the code into a file with an .idr
extension, for example, structs.idr
, and use the Idris compiler and interpreter.
Now that we can run and build basic Idris programs, let’s learn more about the language.