lens-3.10: Lenses, Folds and Traversals

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellNone

Numeric.Lens

Contents

Description

 

Synopsis

Documentation

base :: Integral a => Int -> Prism' String aSource

A prism that shows and reads integers in base-2 through base-36

>>> "100" ^? base 16
Just 256
>>> 1767707668033969 ^. re (base 36)
"helloworld"

integral :: (Integral a, Integral b) => Prism Integer Integer a bSource

This Prism extracts can be used to model the fact that every Integral type is a subset of Integer.

Embedding through the Prism only succeeds if the Integer would pass through unmodified when re-extracted.

Predefined bases