FSharpKoans
FSharpKoans copied to clipboard
Question about Koan 14 - DotNetCollections
Hello,
first let me thank you for this great project :)
I'm curious about SkippingElements
Koan, because there is IMHO quite complicated expectation - at least for beginers I guess.
let SkippingElements() =
let original = [0..5]
let result = Seq.skip 2 original
AssertEquality result __
since there is Seq.skip
it changes from int list
to seq<int>
and there is none example before, how you can create a sequence from numbers, to match the signature and the values.
I know there is planty of ways of passing this test
seq {2..5}
[2..5] |> List.toSeq
and more ...
So I just want to ask if it is a mistake and it should have been List.skip
, which would be much easier for beginners - result would be just [2;3;4;5]
or it is on purpose and you must think about casting types (from list
to seq
).
I'm having a slight issue with this as well as sequences are not properly fleshed out prior to this koan.
In order to pass it using dotnet core 2.2.104, I do:
__ --> (seq{2..5})
As a beginner, this Koan was impossible to solve with the tools provided by previous Koans. Would be cool to get a lesson on creating seq, or a hint that you can convert arrays into them.
So this solution also work:
AssertEquality result (seq[2..5])