Fix Option example

This commit is contained in:
Paweł Lula 2018-01-09 11:43:59 +01:00 committed by Jethro Larson
parent 5dd81ec32c
commit 951e888bd2

View file

@ -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()