(hugr 0)

(mod)

(define-func public example.bools
  (core.fn []
           [(core.adt [[] []]) (core.adt [[] []])])
  (dfg [] [%false %true]
       (signature (core.fn [] [(core.adt [[] []]) (core.adt [[] []])]))
       ((core.load_const (core.const.adt 0 (tuple))) [] [%false]
                                                               (signature (core.fn [] [(core.adt [[] []])])))
       ((core.load_const (core.const.adt 1 (tuple))) [] [%true]
                                                               (signature (core.fn [] [(core.adt [[] []])])))))

(define-func public example.make-pair
  (core.fn []
           [(core.adt
             [[(collections.array.array 5 (arithmetic.int.types.int 6))
               arithmetic.float.types.float64]])])
  (dfg
   [] [%0]
   (signature
    (core.fn
     []
     [(core.adt
       [[(collections.array.array 5 (arithmetic.int.types.int 6))
         arithmetic.float.types.float64]])]))
   ((core.load_const
                     (core.const.adt
                      0
                      (tuple (collections.array.const
                              5
                              (arithmetic.int.types.int 6)
                              [(arithmetic.int.const 6 1)
                               (arithmetic.int.const 6 2)
                               (arithmetic.int.const 6 3)
                               (arithmetic.int.const 6 4)
                               (arithmetic.int.const 6 5)])
                             (arithmetic.float.const_f64 -3.0))))
    [] [%0]
    (signature
     (core.fn
      []
      [(core.adt
        [[(collections.array.array 5 (arithmetic.int.types.int 6))
          arithmetic.float.types.float64]])])))))

(define-func public example.f64-json
  (core.fn []
           [arithmetic.float.types.float64])
  (dfg [] [%0 %1]
       (signature (core.fn [] [arithmetic.float.types.float64 arithmetic.float.types.float64]))
       ((core.load_const
                         (compat.const_json arithmetic.float.types.float64 "{\"c\":\"ConstF64\",\"v\":{\"value\":1.0}}"))
        [] [%0]
        (signature (core.fn [] [arithmetic.float.types.float64])))
    ; The following const is to test that import/export can deal with unknown constants.
       ((core.load_const
                         (compat.const_json arithmetic.float.types.float64 "{\"c\":\"ConstUnknown\",\"v\":{\"value\":1.0}}"))
        [] [%1]
        (signature (core.fn [] [arithmetic.float.types.float64])))))

(declare-func public example.const_as_param
  (param ?c (core.const arithmetic.float.types.float64))
  (core.fn [] [arithmetic.float.types.float64]))
