Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Formatting/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,10 @@ viewed l = fmap (. (getConst . l Const))
--
-- Repeating the example from 'viewed':
--
-- @
-- format ("The person's name is " % squoted (accessed _personName text) % ", and their age is " <> accessed _personAge int) me
-- "The person's name is 'Alex', and their age is 38"
-- @
accessed :: (s -> a) -> Format r (a -> r) -> Format r (s -> r)
accessed accessor = fmap (. accessor)
{-# INLINE accessed #-}
Expand Down