Skip to content

Attributes

Focus on key k. right when present; left s when missing.

(bend.attr "x").get { x = 1; } # right 1
(bend.attr "x").get { } # left { }

Focus on key k with fallback. Always right.

(bend.attrOr "port" 8080).get { } # right 8080
(bend.attrOr "port" 8080).get { port = 3; } # right 3

Chain of attr for nested access.

(bend.path ["a" "b"]).get { a = { b = 42; }; } # right 42

Apply lens to every value in an attrset.

Rename attrset keys with function f.

Contribute Community Sponsor