Skip to content

Q: chunkBySize types  #500

Closed
Closed

Description

@forki

for my property based test I tried:

let chunkBySize<'a when 'a : equality> (xs : 'a []) size  =
    let s = xs |> Seq.chunkBySize size
    let l = xs |> List.ofArray |> List.chunkBySize size
    let a = xs |> Array.chunkBySize size
    Seq.toArray s = a && List.toArray l = a

[<Test>]
let ``chunkBySize is consistent`` () =
    Check.QuickThrowOnFailure chunkBySize<int>
    Check.QuickThrowOnFailure chunkBySize<string>
    Check.QuickThrowOnFailure chunkBySize<float>

and I get a compile error.

I think my test is wrong, but I noticed a type inconsistency:

List.chunkBySize is returning 'a list list
Array.chunkBySize is returning 'a [] []
but Seq.chunkBySize is returning Seq<'a []>

is this good?

Activity

  1. latkin commented on Jun 16, 2015

    @latkin
    Contributor

    This was discussed a bit: #261 (comment)

    Also led to: #272

  2. forki commented on Jun 16, 2015

    @forki
    ContributorAuthor

    so my question is: should I ignore it (and close this issue)?

    /cc @PatrickMcDonald

  3. latkin commented on Jun 16, 2015

    @latkin
    Contributor

    Yes, the signatures are by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions