I want to create a Haskell IO function that uses a function to add an item of a data type to a list, then print a list of those datatypes.
DataType = Str Str Int []
It will always add the same item to the list.
I have this so far:
myFn = putStrLn( listAll ( addData "a" "b" 2000 [] testDatabase ) )
But I get the following errors:
:20 Couldnt match type [Char] with Char, expected String, Actual [String]
Now this may be because listAll outputs a list of strings, and putStrLn can only handle one? But i'm not sure how i'd sort that out.
:19 Function "a" is applied to 3 arguments
But "a" is not a function, it is part of the data type I want to be added (much confusion).