import options, sequtils
var str_seq: seq[string] str_seq = @["a1", "b2", "c3", "d4", "e5", "f6"] echo str_seq echo (str_seq.map(some) & none(string))
Outputs: @["a1", "b2", "c3", "d4", "e5", "f6"] @[Some("a1"), Some("b2"), Some("c3"), Some("d4"), Some("e5"), Some("f6"), None[string]]
Upgrading from nim-1.2.0-1-x86_64.pkg.tar.zst to nim-1.2.4-1-x86_64.pkg.tar.zst means this does not compile: Error: type mismatch: got <seq[string], proc (val: T): Option[some.T]{.inline.}> but expected one of:
2 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
expression: map(str_seq, some)
What is the recommended solution so it works as before?
import options, sequtils
var mySeq = @["a1", "b2", "c3", "d4", "e5", "f6"]
echo mySeq
let myOptSeq = mySeq.mapIt(some(it)) & none(string)
echo myOptSeq