Module
Data.Lens.Barlow
- Package
- purescript-barlow-lens
- Repository
- sigma-andex/purescript-barlow-lens
#Barlow Source
class Barlow :: Symbol -> (Type -> Type -> Type) -> Type -> Type -> Type -> Type -> Constraint
class Barlow (string :: Symbol) p s t a b | string -> s t a b where
Members
barlowImpl :: Proxy string -> Optic p s t a b
Instances
(ParseSymbol string lenses, ConstructBarlow lenses p s t a b) => Barlow string p s t a b
#barlow Source
barlow :: forall @string lenses p s t a b. ParseSymbol string lenses => ConstructBarlow lenses p s t a b => IsSymbol string => Optic p s t a b
Type-safe lens for zooming into a deeply nested record
sky = { zodiac: { virgo: { alpha: "Spica" } } }
view (barlow @"zodiac.virgo.alpha") sky
-- Spica
over (barlow @"zodiac.virgo.alpha") toUpper sky
-- { zodiac: { virgo: { alpha: "SPICA" } } }