0
-- Sample test data

type Sales = (String, String, Int)


testData :: [Sales]

testData :: [("Me and My Broken Heart","Rixton"),("It’s My Birthday","will.i.am"),("Problem","Ariana Grande")]


-- record a sale of a track 

sellTrack :: String String-> [Sales]

sellTrack :: trackName artistName = [Sales] ++ [(trackName, artistName, numberSold)]

I get the error "illegal literal in type : "Me and my broken

1 Answer 1

3

You need to use = in the definition:

testData :: [Sales]

testData = [("Me and My Broken Heart","Rixton",5),("It’s My Birthday","will.i.am",4),("Problem","Ariana Grande",3)]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.