base package:lens

A prism that shows and reads integers in base-2 through base-36 Note: This is an improper prism, since leading 0s are stripped when reading.
>>> "100" ^? base 16
Just 256
>>> 1767707668033969 ^. re (base 36)
"helloworld"
A Lens for reading and writing to the basename Note: This is not a legal Lens unless the outer FilePath has both a directory and filename component and the generated basenames are not null and contain no directory separators.
>>> (basename .~ "filename" $ "path" </> "name.png") == "path" </> "filename.png"
True