// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';

var Curry = require("bs-platform/lib/js/curry.js");
var Json_decode = require("@glennsl/bs-json/src/Json_decode.bs.js");

function oneOrMany(decoder) {
  var partial_arg_0 = function (json) {
    return {
            TAG: /* One */0,
            _0: Curry._1(decoder, json)
          };
  };
  var partial_arg_1 = {
    hd: (function (json) {
        return {
                TAG: /* Many */1,
                _0: Json_decode.list(decoder, json)
              };
      }),
    tl: /* [] */0
  };
  var partial_arg = {
    hd: partial_arg_0,
    tl: partial_arg_1
  };
  return function (param) {
    return Json_decode.oneOf(partial_arg, param);
  };
}

var Decode = {
  oneOrMany: oneOrMany
};

exports.Decode = Decode;
/* No side effect */
