Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top