Skip to content

Commit

Permalink
optics: added 5th exercise to prisms
Browse files Browse the repository at this point in the history
  • Loading branch information
GoNZooo committed Aug 20, 2022
1 parent 67abce1 commit c6c16dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions basics/extras/optics.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ data UserProfile = UserProfile
`Maybe UserProfile` where it effectively answers the question whether a user is married to
someone who has a userprofile on our page.

5. Create a prism `parsableAsNumber :: Prism' Value Value` that will answer the question whether a
`String` (the `Aeson` variant) is parsable as a number. If it is, it should return the string
value turned into a `Number`. Note that you can use `fromInteger` to turn an `Integer` into a
`Scientific` value.

## Traversals and Folds

Traversals allow us to modify multiple values in a structure at once, given some pattern that
Expand Down

0 comments on commit c6c16dd

Please sign in to comment.