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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:31:27+00:00 2026-06-07T03:31:27+00:00

First program i’m writing while reading various Haskell tutorials gives me a Kind mis-match

  • 0

First program i’m writing while reading various Haskell tutorials gives me a “Kind mis-match” error

import qualified Data.Vector as V

class SupervisedLearner l where
    learn :: l (Input n) -> Output n

data Input n = Supervised (V.Vector n ,V.Vector n) | Unsupervised (V.Vector n)
data Output n =  Regression n | KClass (V.Vector n) | Bernoulli (n, n)
newtype Perceptron  = Perceptron (V.Vector Float)

instance SupervisedLearner Perceptron  where
    learn = undefined

What’s confusing me is when i try to follow the type signature of the error,

Kind mis-match
The first argument of `SupervisedLearner' should have kind `*
                                                            -> *',
but `Perceptron' has kind `*'
In the instance declaration for `SupervisedLearner Perceptron'

I just can’t seem to understand where I should look to even begin to correct it.
So my question is two fold, where is the error, and a generally sense, am I using the Haskell typeclass system correctly?

  • 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-07T03:31:29+00:00Added an answer on June 7, 2026 at 3:31 am

    According to your class definition, you need to define a method learn of type l (Input n) -> Output n to make l an instance of SupervisedLearner. So to make Perceptron an instance of SupervisedLearner, learn would have to have the type Perceptron (Input n) -> Output n.

    But the Perceptron type doesn’t take any type arguments, so Perceptron (Input n) is not a valid type. That’s what the error message is complaining about (kind * means that a type doesn’t take any type arguments and kind * -> * means that a type takes one type argument).

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

Sidebar

Related Questions

This is my first program using Haskell. I'm writing it to put into practice
The first program compiled properly.second gave error saying too few argument for foo... is
I wrote my first program in Haskell today. It compiles and runs successfully .
I am just about done writing my first mergesort program and am running into
I am currently writing my first program on C# and I am extremely new
I'm new to python and I'm writing my first program. I would like after
In the first program below there is no error.But for the second program there
This is my very first program for serialization. An error occurred when trying to
I am running my first program in ubuntu. But there was an error when
I wrote my first program almost fifty years ago (yes, coding is still a

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.