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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:23:27+00:00 2026-05-28T17:23:27+00:00

isAlphaNum :: Char -> Bool isAlphaNum = (||) <$> isAlpha <*> isNum I can

  • 0
isAlphaNum :: Char -> Bool
isAlphaNum = (||) <$> isAlpha <*> isNum 

I can see that it works, but I don’t understand where the instances of Applicative (or Functor) come from.

  • 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-28T17:23:28+00:00Added an answer on May 28, 2026 at 5:23 pm

    This is the Applicative instance for ((->) r), functions from a common type. It combines functions with the same first argument type into a single function by duplicating a single argument to use for all of them. (<$>) is function composition, pure is const, and here’s what (<*>) translates to:

    s :: (r -> a -> b) -> (r -> a) -> r -> b
    s f g x = f x (g x)
    

    This function is perhaps better known as the S combinator.

    The ((->) r) functor is also the Reader monad, where the shared argument is the “environment” value, e.g.:

    newtype Reader r a = Reader (r -> a)
    

    I wouldn’t say it’s common to do this for the sake of making functions point-free, but in some cases it can actually improve clarity once you’re used to the idiom. The example you gave, for instance, I can read very easily as meaning “is a character a letter or number”.

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

Sidebar

Related Questions

I have a function that parses a string containing a date(and/or time) e.g. 2009-12-10
I have a look up table for isAlpha. for (int i = 0; i
I'm trying to learn D but am struggling with lack of documentation (or my
I am using in insert statement to convert BDE table (source) to a Firebird
So after having squeezed the last bit of performance out of some Haskell I
we started a paper on Haskell a few weeks ago and just received our
I'm a beginner when it comes to programming and Python. I've done most of

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.