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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:37:06+00:00 2026-06-01T08:37:06+00:00

In GHCI prelude> using :t for finding the types of functions: (.) :: (b

  • 0

In GHCI prelude> using :t for finding the types of functions:

(.) :: (b -> c) -> (a -> b) -> a -> c

(:) :: a -> [a] -> [a]

((.)(:)) :: (a -> b) -> a -> [b] -> [b]   -- (what happened here?)

I understand the result of the single functions, but when partially applied I do not.

what is the type of map map ? I found an answer on this page, how to do this algebraically. But I have a problem applying the same method on the ((.)(:)).

What is the method when you want to know the type of ((.)(:))? Is there a way of thinking that can be used for any partial application of a function?

Thanks in advance.

  • 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-01T08:37:07+00:00Added an answer on June 1, 2026 at 8:37 am

    The best thing to do, when you want to infer a type for a partial application is to start from the most general types of your building blocks and search for matches between the types you’re composing.
    Let me make this more clear by describing you the reasoning I followed for the type you was searching for.

    First of all, let’s rename the type variables for (:) in order to avoid confusion:

    (.) :: (b -> c) -> (a -> b) -> a -> c
    (:) :: d -> [d] -> [d]
    

    (.) (:) partially applies (:) to (.), providing its first argument only. This means that the first argument of (.), that is of type (b -> c), is instantiated to (d -> ([d] -> [d])), with b == d and c == ([d] -> [d]) (remember that -> is right associative).

    If you apply this type substitution in the whole thing, you get that the partially applied (.) loses its first argument (it has been fixed as (:)) and results in (a -> d) -> a -> ([d] -> [d]), that is equivalent to (a -> d) -> a -> [d] -> [d] (again, by right-associativity): this is the type expression you got from ghci.

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

Sidebar

Related Questions

In GHCi: Prelude> (+3) 2 5 Prelude> (*3) 2 6 Prelude> (/3) 2 0.6666666666666666
In Haskell, I can check a function's type in ghci by using :t :
When I :load a Haskell script into GHCi, it changes the prompt from Prelude>
Unfortunately cabal-dev ghci does not work in this project, i get an error: Loading
I am using GHCi as my interpreter, The specifications for my assignment are to
So using GHCI, these statements are equivalent which makes sense to me because the
So using GHCI, these statements are equivalent which makes sense to me because the
Look at this output from ghci: Prelude> :t Data.Map.lookup Data.Map.lookup :: Ord k =>
I'm complete newbie on Haskell. My Haskell script with GHCi , Prelude> let a
So I am doing this in GHCI Prelude> show (5, 6) will get me

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.