type rgb = [#Red | #Green | #Blue]
type color = [rgb | #Orange | #Yellow | #Purple]

type t = [#variant]
type t = [#Variant]
type t = [#"type"]
type t = [#"va r ia nt"]
type t = [#"Variant ⛰"]

let id = (x: [> #Red | #Green | #Blue]) => x
let upper = (x: [< #Red | #Green]) => true
type point = [#Point(float, float)]
type \"type" = [#"Point🗿"(\"let", float)]
type shape = [
  | #Rectangle(point, point)
  | #Circle(point, float)
]

type madness = [< #"type" & (\"let") & (\"Super exotic") | #"Bad Idea"]

let error_of_exn: exn => option<[#Ok(error) | #Already_displayed]> = x

external make: (
  ~_type: @string
  [
    | #basis
    | #basisClosed
    | #basisOpen
    | #linear
    | #linearClosed
    | #natural
    | #monotoneX
    | #monotoneY
    | #monotone
    | #step
    | #stepBefore
    | #stepAfter
  ]=?,
  ~dataKey: Config.dataItem => Js.null<yValue>,
  ~stroke: string=?,
  ~strokeWidth: float=?,
  ~strokeDasharray: string=?,
  ~children: React.element=?,
  ~dot: Dot.t=?,
  ~activeDot: Dot.t=?,
  ~label: string=?,
  ~name: string=?,
  ~connectNulls: bool=?,
) => React.element = "Line"

type empty_conj = X([< #X & ('a) & (int, float)]): empty_conj

type conj = X([< #X(int) & ([< #B(int) & (float)])]): conj

module type Conjunctive = {
  type u1 = [#A | #B]
  type u2 = [#A | #B | #C]

  let f: [< #T([< u2]) & ([< u2]) & ([< u1])] => unit
  let g: [< #S & ([< u2]) & ([< u2]) & ([< u1])] => unit
}

type x = [
  | #Fooooooooooooooooooooooooooooooooooooooo
  | #Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar
  | #Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
]

type animation = [
  | #"ease-in"
  | #"ease-out"
  | #"never ease ✍️"
]

module type Conjunctive = {
  type u1 = [#A | #B]
  type u2 = [#A | #B | #C]

  let f: [< #T([< u2]) & ([< u2]) & ([< u1])] => unit
  let g: [< #S & ([< u2]) & ([< u2]) & ([< u1])] => unit
  let g: [<
    | #"Exotic-S+" & ([< #"Exotic-u2+"]) & ([< #"Exotic-u2-"]) & ([< #"Exotic-u1+++"])
  ] => unit
}

// should break because user wrote it over serveral lines
type currencyPoly = [
  | #USD
  | #CAD
  | #EUR
]

// should not break, user wrote it on one line
type currencyPoly = [#USD | #CAD | #EUR]
//
// should break, line length exceeded
type currencyPoly = [
  | #UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUSD
  | #CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD
  | #EUUUUUUUUUUUUUUUUUUUR
]

type t = [s]
type t = [ListStyleType.t]

type permissions = [
  | #777
  | #644
]

type t = [
  | #1(string)
  | #2(int, string)
]

// don't pick int with suffix as numeric polyvar
type t = [#"10s" | #"20t"]

// comments
type foo = [
  | // before bar
  #Bar // after bar
  | // before baz
  #Baz
] // after baz

// doc comments on inherited polyvariant types
type rgb = [#Red | #Green | #Blue]
type color = [
  | /** Primary colors from RGB */ rgb
  /** A warm color */
  | #Orange
  /** Another warm color */
  | #Yellow
]
