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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:26:17+00:00 2026-05-18T02:26:17+00:00

this is a really basic question I know, I am a begginer in Haskell.

  • 0

this is a really basic question I know, I am a begginer in Haskell. So, I am wondering how to “take” the lists from a function like:

putStr( f [[1,2,3],[4,5,6],[6,7,8]])

I don’t know if I am expressing this correctly, but I want to create a function f that takes this type:

type Matrix a = [[a]]
type IntMat = Matrix Integer

and then does some things on each “row” of the matrix, nameley the inner lists.

The thing is, I am not quite sure as to how to address them! :S
If I am not making ANY sense at all, please ask me to explain!

Thank you 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-05-18T02:26:17+00:00Added an answer on May 18, 2026 at 2:26 am

    “find the max of each of the inner lists”, “find their length to use later on”, both of them can be done with the map higher-order function.

    Prelude> let a = [[1,2,3],[4,5,6],[6,7,8]] :: [[Integer]]
    Prelude> map maximum a
    [3,6,8]
    Prelude> map length a
    [3,3,3]
    

    If you have a list M = [a, b, c, d, ...], and you want to use a function f to transform the list into N = [f(a), f(b), f(c), f(d), ...], then you could use the function map (N == map f M).

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

Sidebar

Related Questions

This is a really basic question but... I have some code like this var
This is a really basic question but this is the first time I've used
I'm just curious about this really, does anyone know why they broke convention on
This really, really urks me, so I hope that someone can give me a
This really has my stumped today. I'm sure its simple, but... Here is my
Is this really the easiest way to do this? http://simplesamples.info/MFC/Clipboard.php
I just came across a C++ SDK that makes heavy use of this really
This is really only easy to explain with an example, so to remove the
This sounds really stupid, but I was told that you could drag-and-drop visual components
This is really stumping me today. I'm sure its not that hard, but I

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.