Module

Data.Lens.Barlow

Package
purescript-barlow-lens
Repository
sigma-andex/purescript-barlow-lens

#TList Source

data TList

#TCons Source

data TCons :: forall k. k -> TList -> TList

Instances

#LensType Source

#QuestionMark Source

data QuestionMark :: LensType

Instances

#RightArrow Source

data RightArrow :: LensType

Instances

#LeftArrow Source

data LeftArrow :: LensType

Instances

#Plus Source

data Plus :: LensType

Instances

#ExclamationMark Source

data ExclamationMark :: LensType

Instances

#RecordField Source

data RecordField :: Symbol -> LensType

Instances

#ParseSymbol Source

class ParseSymbol (string :: Symbol) (attributes :: TList) | string -> attributes

Instances

#Parse1Symbol Source

class Parse1Symbol (head :: Symbol) (tail :: Symbol) (out :: TList) | head tail -> out

Instances

#ConstructBarlow Source

class ConstructBarlow (attributes :: TList) p input output | attributes -> input output where

Members

Instances

#Barlow Source

class Barlow (string :: Symbol) p input output | string -> input output where

Members

  • barlow :: Proxy string -> Optic' p input output

    Type-safe lens for zooming into a deeply nested record

    sky = { zodiac: { virgo: { alpha: "Spica" } } }
    view (barlow (key :: _ "zodiac.virgo.alpha")) sky
    -- Spica 
    over (barlow (key :: _ "zodiac.virgo.alpha")) toUpper sky
    -- { zodiac: { virgo: { alpha: "SPICA" } } }
    

Instances

#key Source

key :: forall k. Proxy k

Just an alias for Proxy to make selection a bit nicer