Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base spreadsheet parsers on string columns #394

Merged
merged 3 commits into from
Jun 26, 2024
Merged

Base spreadsheet parsers on string columns #394

merged 3 commits into from
Jun 26, 2024

Conversation

HLWeil
Copy link
Member

@HLWeil HLWeil commented Jun 26, 2024

closes #389

@HLWeil HLWeil requested a review from Freymaurer June 26, 2024 11:50
Copy link
Collaborator

@Freymaurer Freymaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets say i have a sequence of header strings and a seq<seq> for table-body-values. Which functions must i use to generate a ArcTable? Are these findable? Do they exist in this state?

@HLWeil
Copy link
Member Author

HLWeil commented Jun 26, 2024

open ARCtrl.Spreadsheet

let headerStrings : string seq = ...
let rowStringSeqs : string seq seq = ...

let columns = 
    Seq.append [headerStrings] rowStringSeqs 
    |> Seq.transpose

let columnsList = 
    columns 
    |> Seq.toList
    |> List.map (Seq.toList)


let arcTable = ArcTable.composeColumns columnsList 

@Freymaurer
Copy link
Collaborator

open ARCtrl.Spreadsheet

let headerStrings : string seq = ...
let rowStringSeqs : string seq seq = ...

let columns = 
    Seq.append [headerStrings] rowStringSeqs 
    |> Seq.transpose

let columnsList = 
    columns 
    |> Seq.toList
    |> List.map (Seq.toList)


let arcTable = ArcTable.composeColumns columnsList 

love it!

@HLWeil
Copy link
Member Author

HLWeil commented Jun 26, 2024

But thinking about switching from list to array. Because I have quite a few .Item calls, which are painfully slow for lists.

@Freymaurer
Copy link
Collaborator

Would be fine with it 👍

@HLWeil
Copy link
Member Author

HLWeil commented Jun 26, 2024

open ARCtrl.Spreadsheet

let headerStrings : string seq = ...
let rowStringSeqs : string seq seq = ...

let columns = 
    Seq.append [headerStrings] rowStringSeqs 
    |> Seq.transpose

let columnsList = 
    columns 
    |> Seq.toList
    |> List.map (Seq.toList)


let arcTable = ArcTable.composeColumns columnsList 

Now it's

open ARCtrl.Spreadsheet

let headerStrings : string seq = ...
let rowStringSeqs : string seq seq = ...

let columns = 
    Seq.append [headerStrings] rowStringSeqs 
    |> Seq.transpose

let columnsArray = 
    columns 
    |> Seq.toArray
    |> Array.map (Seq.toArray)

let arcTable = ArcTable.composeColumns columnsArray

@HLWeil HLWeil merged commit 4da4e18 into main Jun 26, 2024
2 checks passed
@HLWeil HLWeil deleted the spreadsheet branch June 27, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Offer a string based parsing to ArcTable
2 participants