Haskell: Creating record of list of string and pair of <string and list of string>

368 views Asked by At

How to create a record of list of string and, pair of in Haskell

I tried the following

For creating a record of list of string

data testList = test [string]
    deriving (Show, Eq)

When I run it, it gives me the following error

Not a data constructor: `test'

For creating a record of pair of

data testList = test (String,[string])
    deriving (Show, Eq)

It also gives the same error

Not a data constructor: `test'

can anyone explain me the problem and solution for it.

1

There are 1 answers

1
Jake On BEST ANSWER

The first letter of data types must be a capital letter. wikipedia/haskell/type declarations