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

  • Home
  • SEARCH
  • 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 7843977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:44:01+00:00 2026-06-02T16:44:01+00:00

I am using the Data.List.Vector in my program, and now I would like to

  • 0

I am using the Data.List.Vector in my program, and now I would like to use quickCheck for it. However, there is no instance for that. Since there already is an arbitrary for [Double], I thought I could do something like

instance Arbitrary V.Vector Double where
    arbitrary = V.fromList (arbitrary :: [Double])

alas, GHC does not like this at all:

`Arbitrary' is applied to too many type arguments
In the instance declaration for `Arbitrary V.Vector Double'

I guess I could also just make a bunch of properties that take in a [Double] and uses V.fromList, but that seems tedious.

  • 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-06-02T16:44:02+00:00Added an answer on June 2, 2026 at 4:44 pm

    Your problem is that you need to parenthesize it, like instance Arbitrary (V.Vector Double), etc. But there’s a better way to do it:

    instance (Arbitrary a) => Arbitrary (V.Vector a) where
        arbitrary = fmap V.fromList arbitrary
    

    Note that you need the fmap because arbitrary is a value of type Gen a, and so in order to go from Gen [a] to Gen (V.Vector a) you need to lift V.fromList into Gen, which you can do since it’s a functor.

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

Sidebar

Related Questions

I have a test list that I am trying to capture data from using
Below is the code that I'm using in ms access to list the data
I'm using a DropDownList with a data source which successfully populates the list. However,
I'm using SPServices to get some data out of a list like so: listSiteTabURLSalesTool
My code is using std::count() on a list of an abstract data type that
I'm trying to access list data using SSRS 2008. I have created an XML
I am using a ToolStripComboBox to list some data. I am populating this combo
I am using rawQuery method to get the list of data as Cursor and
I'm trying to display some data from a list sharepoint and then using jquery
I am trying to sort data which is from Generic List object. By using

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.