Ahsan
Ahsan

Reputation: 797

represent list with no entries

very simple how would you represent a list with no entries

Upvotes: 1

Views: 137

Answers (2)

Dan Burton
Dan Burton

Reputation: 53725

Also, "" is an empty String, and Strings are just lists of Chars.

Upvotes: 1

Yacoby
Yacoby

Reputation: 55465

An empty list is simply []

For example, defining a variable that holds an empty list can be done by:

emptyList :: [a]
emptyList = []

Upvotes: 4

Related Questions