Works fine once you call the correct map: 
    
    
    import sugar, sequtils
    import std/options except map
    
    converter to_option*[T](t: T): Option[T] = some(t)
    
    template pick*[T](list: openarray[T], field: untyped): untyped =
      list.map((v) => v.`field`)
    
    echo @[(name: "John"), (name: "Sarah")].pick(name)
    
    
    Run

Reply via email to