lensOf

inline fun <P, T> lensOf(id: String, crossinline getter: (P) -> T, crossinline setter: (P, T) -> P): Lens<P, T>

convenience function to create a Lens

Parameters

id

of the Lens

getter

of the Lens

setter

of the Lens


inline fun <P> lensOf(crossinline format: (P) -> String, crossinline parse: (String) -> P): Lens<P, String>

creates a Lens converting P to and from a String

Parameters

format

function for formatting a P to String

parse

function for parsing a String to P