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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:40:19+00:00 2026-05-13T10:40:19+00:00

As some of you may know, the type inference errors in Haskell can be

  • 0

As some of you may know, the type inference errors in Haskell can be cryptic at times. I was trying to write a function that mapped alphabetic characters to their uppercase version, and I came up with this:

toUpper :: Char -> Char
toUpper char = maybe " " (\a -> a) isValue
    where charMap = zip ['a' .. 'z'] ['A' .. 'Z']
          isValue = lookup char charMap

But it complains about the following:

    wordsearch.hs:2:35:
        Couldn't match expected type `[Char]' against inferred type `Char'
          Expected type: Maybe [Char]
          Inferred type: Maybe Char
        In the third argument of `maybe', namely `isValue'
        In the expression: maybe " " (\ a -> a) isValue

The error is doesn’t make sense to me as i’m a newbie, can anyone help?

  • 1 1 Answer
  • 2 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-13T10:40:20+00:00Added an answer on May 13, 2026 at 10:40 am
    " " :: [Char]
    ' ' :: Char
    

    You want maybe ' ' id isValue, not maybe " " id isValue.

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

Sidebar

Related Questions

Some of you may know the method in Ruby that allows you to reverse
I know that this may be an amateur question but for some reason I
As some of you may know, use of the LIMIT keyword in MySQL does
As some of you may know in python2.7/3.2 we'll get OrderedDict with PEP372 however
As you may know, in many occasions, there is a need to flag some
I know this question may be a duplicate of some other ones, but I
I'm trying to create a constructor for a custom type, but for some reason,
We're a small dev team working with some GLSL that may be too large
I know some people may just respond never as long as there's user input.
I am trying to figure out how to define a function that works on

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.