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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:52:20+00:00 2026-05-26T05:52:20+00:00

I am trying to print a large list with F# and am a difficult

  • 0

I am trying to print a large list with F# and am a difficult time. I am trying to create a lexical analyzer in F# I believe I am done but I can’t seem to get it to print the entire list to check it.

here is an example of what I am trying to do

let modifierReg = Regex("(public|private)");
let isModifier str = if (modifierReg.IsMatch(str)) then ["Modifier"; str] else ["Keyword";    str]

let readLines filePath = seq {
    use sr = new StreamReader (filePath:string)
    while not sr.EndOfStream do
        yield sr.ReadLine () } 

let splitLines listArray =
    listArray 
    |> Seq.map (fun (line: string) -> let m = Regex.Match(line, commentReg) in if m.Success then (m.Groups.Item 1).Value.Split([|' '|], System.StringSplitOptions.RemoveEmptyEntries) else line.Split([|' '|], System.StringSplitOptions.RemoveEmptyEntries) )

let res = 
    string1 
    |> readLines
    |> splitLines

let scanLines lexicons =
    lexicons 
    |> Seq.map (fun strArray -> strArray |> Seq.map (fun str -> isModifier(str)))

let printSeq seq =
    printfn "%A" seq

let scanner filePath =
    filePath 
    |> readLines
    |> splitLines
    |> scanLines

let scannerResults = scanner pathToCode
printSeq scannerResults

When I try to print the list I get the following

seq
[seq [[“Keyword”; “class”]; [“Identifier”; “A”]]; seq [[“Block”; “{“]];
seq [[“Modifier”; “public”]; [“Type”; “int”]; [“Identifier”; “x;”]];
seq [[“Modifier”; “public”]; [“Type”; “int”]; [“Identifier”; “y;”]]; …]

I can’t get it to print any further. I get the same behavior with something as simple as the following

printfn "%a" [1 .. 101]]

I can’t seem to figure out how to print it off. Anyone have any experience with this? I can’t seem to find any examples

  • 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-26T05:52:21+00:00Added an answer on May 26, 2026 at 5:52 am

    Seq.iter will iterate over all the elements of a sequence, so e.g.

    somelist|> Seq.iter (printfn "%A")
    

    will print each of the elements. (The “%A” specifier is good at the common case for printing arbitrary data, but for large lists or whatnot, you can exercise finer control, as here, by iterating over every element and printing each individually, e.g. on a new line as above.)

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

Sidebar

Related Questions

I'm trying to print a large string to alivepdf. I'm splitting the string by
I'm trying to print out a list of products on a page. This is
I'm trying to implement a comparison chart-like table, and a large list of selectable
I'm trying to get a list of changed/added/deleted/etc. files for a commit in my
This is a very strange issue. I'm trying to print a large text file,
I'm trying to emulate MS Office print dialog's printer selection combobox. The drop-down list
I'm trying to create a simple animation. Long story short, I've got a list
I am trying to get a list of frequencies present in an input audio
I'm trying to divide some large numbers in Python but i'm getting some strange
Im trying to use printf in my assembley code in model large, and 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.