Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6735805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:03:22+00:00 2026-05-26T11:03:22+00:00

How to create a list of records in haskell I have a Record data

  • 0

How to create a list of records in haskell

I have a Record

data TestList = Temp1 (String,[String])
          | Temp2 (String,[(String,String)])
    deriving (Show, Eq)

I am creating a list of records

testLists :: [TestList]
testLists =  [minBound..maxBound]

When I run, it throws me an error.

No instance for (Enum TestList)
      arising from the arithmetic sequence `minBound .. maxBound'
    Possible fix: add an instance declaration for (Enum TestList)
    In the expression: [minBound .. maxBound]
    In an equation for `testLists': testLists = [minBound .. maxBound]

It gives me a possible fix but I don’t understand what it means. can anyone explain it and tell me how to fix it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:03:22+00:00Added an answer on May 26, 2026 at 11:03 am

    You can’t use minBound and maxBound unless you declare beforehand what they mean for your type (which by the way is not a record type). You must, as the error also tells you, declare the type as an instance of Bounded. Without knowledge of what your type is to represent, it’s impossible to say what such a declaration should look like exactly, but its general form is

    instance Bounded TestList where
      minBound = ...
      maxBound = ...
    

    (Fill in the ...)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to create a record of list of string and, pair of in Haskell
I would like to create a list of records. I can add one record
I have the following code. I need to create list separators before A elements,
I want to create a list of columns in SQL Server 2005 that have
I want to create a list of records with checkboxes on the left side....kinda
I have a simple record structure consisting of a header (H) and a list
I have a page that displays a list of records. The user can select
Is it possible with BLToolKit (http://bltoolkit.net) to create a set of records for list
I create a List showing data from a RecordStore. I tried to update a
I have a string List time1 with values (00:00 AM,00:30 AM, 01:00 AM, 01:30

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.