Skip to content

Conversation

@PaulJohnson
Copy link

Implements #35. "nullIsNothing" converts a Value prism into one that accepts "null" as "Nothing".

Converts a Value prism into one that accepts "null" as "Nothing".
@paolino
Copy link

paolino commented Aug 26, 2021

Hi, while you are at that I would suggest to add the other natural null handler

nullIsDefault :: q -> Prism' Value q -> Prism' Value q
nullIsDefault q p = prism'
  do review p 
  do \case 
      Null -> Just q
      x -> preview p x 

Thanks for picking this up

@PaulJohnson
Copy link
Author

OK, done.

@ekmett
Copy link
Member

ekmett commented Mar 8, 2022

This is covered by non Null using the base lens library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants