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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:02:35+00:00 2026-05-17T19:02:35+00:00

This is a follow up to a previous question; I got an answer I

  • 0

This is a follow up to a previous question; I got an answer I didn’t really understand, but accepted. So I’ll ask it again.

I still don’t understand how this makes sense:

type Parse a b = [a] -> [(b,[a])]
build :: Parse a b -> ( b -> c ) -> Parse a c
build p f inp = [ (f x, rem) | (x, rem) <- p inp ]

Now, obviously, p binds to the first argument of type Parse a b. And, again obviously f binds to the second argument (b -> c). My question remains what does inp bind to?

If Parse a b is a type synonym for [a] -> [(b,[a])] I thought from the last question I could just substitute it:

build :: [a] -> [(b,[a])] -> ( b -> c ) -> [a] -> [(c,[a])]

However, I don’t see that making any sense either with the definition:

build p f inp = [ (f x, rem) | (x, rem) <- p inp ]

Would someone explain type synonyms?

  • 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-17T19:02:36+00:00Added an answer on May 17, 2026 at 7:02 pm

    Now, obviously, p binds to the first argument of type Parse a b. And, again obviously f binds to the second argument (b -> c). My question remains what does inp bind to?

    The argument of type [a]

    If Parse a b is a type synonym for [a] -> [(b,[a])] I thought from the last question I could just substitute it:

    build :: [a] -> [(b,[a])] -> ( b -> c ) -> [a] -> [(c,[a])]
    

    Almost; you need to parenthesize the substitutions:

    build :: ([a] -> [(b,[a])]) -> ( b -> c ) -> ([a] -> [(c,[a])])
    

    Because -> is right-associative you can remove the parentheses at the end, but not at the beginning, so you get:

    build :: ([a] -> [(b,[a])]) -> ( b -> c ) -> [a] -> [(c,[a])]
    

    This should make it obvious why inp has type [a].

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

Sidebar

Related Questions

This is a follow up of the Previous Question It got really complicated so
This is a CSS related question, I got one good answer from my previous
This is really a follow on question to a previous one , where I
This is a follow-up on my previous question . Once I got the problem
Note: This is a follow-up to an answer on a previous question . I'm
This is a follow-up to a previous question I had about interfaces. I received
This question is a follow up to my previous question about getting the HTML
This is a follow up question to This Question . I like (and understand)
Just a follow up from a previous question. I've got the following form.. <body
This is a follow up post of my previous question about BASIC auth over

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.