SO 64392058

node v10.22.1
version: 1.0.0
endpointsharetweet
const {Maybe} = require ('ramda-fantasy') const {Just, Nothing, maybe} = Maybe const validate = v => v === "fred" ? Just ("Y") : Nothing () const vv = val => Maybe (val) .chain (validate) .getOrElse ('N') console .log ([ vv(null), // 'N' vv('fred'), // 'Y' vv('ding') // 'N' ])
Loading…

no comments

    sign in to comment