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 6739601
In Process

The Archive Base Latest Questions

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

I run into trouble trying to make Vector.Generic.Vector an instance of other typeclasses (in

  • 0

I run into trouble trying to make Vector.Generic.Vector an instance of other typeclasses (in my case – Functor).

I could settle for adding a Functor instance to Vector.Unboxed.Vector, but I couldn’t figure out the syntax for that either.
My best take was to try something like:

instance (U.Unbox a, U.Unbox b) => Functor U.Vector where
    fmap = U.map

But the compiler (justfully) complained that ‘a’ and ‘b’ where nowhere after ‘=>’.
Can I even make this definition for Functor, as it assumes more restrictions on the types fmap is allowed to take?

Most stuff I found in SO was too advanced for me to figure out, so please be gentle 🙂

  • 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:30:30+00:00Added an answer on May 26, 2026 at 11:30 am

    Think of the type of fmap:

    fmap :: Functor f => (a -> b) -> f a -> f b
    

    You are trying to add the constraint that a and b are both instances of Unbox. This is not doable because fmap is completely general while a map of an unboxed Vector is specific to instances Unbox.

    It cannot be made a Functor.

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

Sidebar

Related Questions

I have been using SmartGWT but have run into trouble mixing SmartGWT with other
I have run into trouble trying to implement functionality for serializing some classes in
I recently run into trouble when trying to AddRange(IEnumerable) to a List. Probably a
Just trying to implement mobFox into my app, but having trouble to make it
While trying to follow the python-libmemcached instructions at http://code.google.com/p/python-libmemcached/ I run into trouble at
I'm working on some SDL stuff and I've run into some trouble when trying
I've recently adopted the GWT framework and I've run into trouble. I'm creating a
Having successfully installed opencv 2.0 with python bindings I'm starting to run into trouble
I have run into some trouble with the gd library's imagefilledpolygon() . For some
I run into the following issue semi-regularly: I make changes to XAML or some

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.