// maybe :: ?a -> Maybe a
export const maybe = x => {
  return x != null && x !== undefined ? Just(x) : Nothing;
};

// identity :: a -> a
export const identity = x => x;

// prop :: String -> Object -> Maybe x
export const prop = x => o => maybe(o[x]);

// propIn :: Array -> Object -> Maybe b
export const propIn = xs =>
  o => xs.reduce((acc, cur) => acc.chain(prop(cur)), Just(o));