mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +00:00
Fix Option example
This commit is contained in:
parent
5dd81ec32c
commit
951e888bd2
1 changed files with 1 additions and 1 deletions
|
|
@ -892,7 +892,7 @@ const getItem = (cart) => maybeProp('item', cart)
|
|||
const getPrice = (item) => maybeProp('price', item)
|
||||
|
||||
// getNestedPrice :: cart -> Option a
|
||||
const getNestedPrice = (cart) => getItem(obj).chain(getPrice)
|
||||
const getNestedPrice = (cart) => getItem(cart).chain(getPrice)
|
||||
|
||||
getNestedPrice({}) // None()
|
||||
getNestedPrice({item: {foo: 1}}) // None()
|
||||
|
|
|
|||
Loading…
Reference in a new issue