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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:07:41+00:00 2026-06-03T05:07:41+00:00

initials :: String -> String -> String initials firstname lastname = [f] ++ .

  • 0
initials :: String -> String -> String
initials firstname lastname = [f] ++ ". " ++ [l] ++ "."
    where (f:_) = firstname
          (l:_) = lastname 

For this code. I got error

parse error on input `='

Why?

  • 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-03T05:07:43+00:00Added an answer on June 3, 2026 at 5:07 am

    You use a tab character before the where keyword. To GHC it looks like this:

    ␉       where␠(f:_)␠=␠firstname
    ␠␠␠␠␠␠␠␠␠(l:_)␠=␠lastname 
    

    So, GHC thinks that the first line in the where block starts at column 14 (tab counts for 8 columns iirc) while the second line starts at column 9, which causes the error.

    You should use a good text editor that converts tabs into 4 spaces for you.

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

Sidebar

Related Questions

On MSVC 2005, I have the following code. std::ostringstream stream(initial string ); stream <<
In my application when I try to get the connection string by using this
My question is this: Is string concatenation in C# safe? If string concatenation leads
I have this initial string. 'bananaappleorangestrawberryapplepear' And also have a tuple with strings: ('apple',
I have this error, and i roughly know where it is, but do not
I want to sort the paragraphs in my text according to their initials with
I just started learning Java and I'm having trouble formatting string. In the problem
The code below is from SAMATE Reference Dataset . I used it to test
I'm thinking this should be easy, but I can't seem to figure this out.
I've got a simple POCO class to hold data extracted from an XML file

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.