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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:46:00+00:00 2026-06-15T12:46:00+00:00

I have an arrow which outputs a list of values ( a b [c]

  • 0

I have an arrow which outputs a list of values (a b [c]) and another arrow which accepts a single value of that type (a c d). What I need basically is a way to chain them or uplift the second arrow to a [c] [d].

  • 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-15T12:46:02+00:00Added an answer on June 15, 2026 at 12:46 pm

    You cannot do this with just Arrow type class. Lifting a b c into a [b] [c] requires choice between [] and (:) case. Luckily for us, ArrowChoice offers exactly this operation.

    mapA :: ArrowChoice a => a b c -> a [b] [c]
    mapA f = proc list -> case list of
        []   -> returnA -< []
        x:xs -> do
            y  <- f      -< x
            ys <- mapA f -< xs
            returnA      -< y:ys
    

    Your function is then simply:

    chain :: ArrowChoice a => a b [c] -> a c d -> a b [d]
    chain f g = f >>> mapA g
    

    Without proc notation, we would need a function that translates list constructors into Either:

    listCase :: [a] -> Either () (a, [a])
    listCase []     = Left ()
    listCase (x:xs) = Right (x,xs)
    
    mapA f = arr listCase >>>
        arr (const []) ||| (f *** mapA f >>> arr (uncurry (:)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking for a way to create an animated arrow which points
I have a ViewFlipper which contains a few linear layouts. I need to allow
Please neglect any other arrow excluding the single simple arrow on which 1..1 or
I have 3 selects that I am enabling keyboard navigation(right and left arrow keys)
I have the following code which expands and collapses a subcategory when the arrow
i have an application which has 3X4 matrix of images using arrow key(up,right,top,bottom) i
I have a function that creates a state. A state is defined as: type
I have an arrow that points to the bottom for each table cell. When
When I analyze my iPhone app I have a blue arrow warning which says:
I have a single form field and I need to be able to detect

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.