cfhammill / lenses

Elegant Data Manipulation with Lenses
https://cfhammill.github.io/lenses
Other
27 stars 4 forks source link

More lenses to implement #9

Closed cfhammill closed 6 years ago

cfhammill commented 6 years ago

Looking in base for setters yields to following:

grep("<-", ls(env = getNamespace("base")), value = TRUE)
#>  [1] "[[<-"                    "[[<-.data.frame"        
#>  [3] "[[<-.factor"             "[[<-.numeric_version"   
#>  [5] "[<-"                     "[<-.data.frame"         
#>  [7] "[<-.Date"                "[<-.factor"             
#>  [9] "[<-.numeric_version"     "[<-.POSIXct"            
#> [11] "[<-.POSIXlt"             "@<-"                    
#> [13] "<-"                      "<<-"                    
#> [15] "$<-"                     "$<-.data.frame"         
#> [17] "attr<-"                  "attributes<-"           
#> [19] "body<-"                  "class<-"                
#> [21] "colnames<-"              "comment<-"              
#> [23] "diag<-"                  "dim<-"                  
#> [25] "dimnames<-"              "dimnames<-.data.frame"  
#> [27] "Encoding<-"              "environment<-"          
#> [29] "formals<-"               "is.na<-"                
#> [31] "is.na<-.default"         "is.na<-.factor"         
#> [33] "is.na<-.numeric_version" "length<-"               
#> [35] "length<-.Date"           "length<-.difftime"      
#> [37] "length<-.factor"         "length<-.POSIXct"       
#> [39] "length<-.POSIXlt"        "levels<-"               
#> [41] "levels<-.factor"         "mode<-"                 
#> [43] "mostattributes<-"        "names<-"                
#> [45] "names<-.POSIXlt"         "oldClass<-"             
#> [47] "parent.env<-"            "regmatches<-"           
#> [49] "row.names<-"             "row.names<-.data.frame" 
#> [51] "row.names<-.default"     "rownames<-"             
#> [53] "split<-"                 "split<-.data.frame"     
#> [55] "split<-.default"         "storage.mode<-"         
#> [57] "substr<-"                "substring<-"            
#> [59] "units<-"                 "units<-.difftime"

Created on 2018-09-25 by the reprex package (v0.2.0).

some that immediately strike me as worth implementing:

open to including others, but see them as either difficult, not useful, or ill-defined. Plus some other ones

seems like there is a pretty big space of interconvertable type lenses to make.

cfhammill commented 6 years ago

moving the remaining to a new issue, they are of a different flavour