hamlet/FinMapFn-functor.ss
(module FinMapFn-functor (planet chongkai/sml)
  (#%module-begin
   (Program:
    (FUNDECTopDec:
     (FunDec:
      (FunBind:
       (FunId: FinMapFn-functor)
       (StrId: Key-struct)
       (IDSigExp: (SigId: ORD_KEY-sig))
       (SEALStrExp:
        (STRUCTStrExp:
         (SEQStrDec:
          (STRUCTUREStrDec: (StrBind: (StrId: BinaryMap-struct) (APPStrExp: (FunId: BinaryMapFn-functor) (IDStrExp: (LongStrId: Key-struct)))))
          (SEQStrDec:
           (DECStrDec: (OPENDec: (LongStrId: BinaryMap-struct)))
           (SEQStrDec:
            (DECStrDec: (EXCEPTIONDec: (EQUALExBind: (VId: NotFound) (LongVId: LibBase.NotFound))))
            (SEQStrDec:
             (DECStrDec: (EXCEPTIONDec: (NEWExBind: (VId: Duplicate))))
             (SEQStrDec:
              (DECStrDec:
               (VALDec:
                (TyVarseq:)
                (RECValBind:
                 (PLAINValBind:
                  (ATPat: (IDAtPat: (LongVId: fromList)))
                  (FNExp:
                   (Match:
                    (Mrule:
                     (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: kvs)))))
                     (ATExp:
                      (PARAtExp:
                       (APPExp:
                        (ATExp:
                         (PARAtExp:
                          (APPExp:
                           (ATExp:
                            (PARAtExp:
                             (APPExp:
                              (ATExp: (IDAtExp: (LongVId: List.foldl)))
                              (PARAtExp:
                               (FNExp:
                                (Match:
                                 (Mrule:
                                  (ATPat:
                                   (RECORDAtPat:
                                    (FIELDPatRow:
                                     (Lab: |1|)
                                     (ATPat:
                                      (RECORDAtPat:
                                       (FIELDPatRow:
                                        (Lab: |1|)
                                        (ATPat: (IDAtPat: (LongVId: k)))
                                        (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: v)))))))
                                     (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: m)))))))
                                  (IFExp:
                                   (ATExp:
                                    (PARAtExp:
                                     (APPExp:
                                      (ATExp: (IDAtExp: (LongVId: inDomain)))
                                      (RECORDAtExp:
                                       (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: m))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: k)))))))))
                                   (RAISEExp: (ATExp: (IDAtExp: (LongVId: Duplicate))))
                                   (ATExp:
                                    (PARAtExp:
                                     (APPExp:
                                      (ATExp: (IDAtExp: (LongVId: insert)))
                                      (RECORDAtExp:
                                       (ExpRow:
                                        (Lab: |1|)
                                        (ATExp: (IDAtExp: (LongVId: m)))
                                        (ExpRow:
                                         (Lab: |2|)
                                         (ATExp: (IDAtExp: (LongVId: k)))
                                         (ExpRow: (Lab: |3|) (ATExp: (IDAtExp: (LongVId: v))))))))))))))))))
                           (IDAtExp: (LongVId: empty)))))
                        (IDAtExp: (LongVId: kvs))))))))))))
              (SEQStrDec:
               (DECStrDec:
                (VALDec:
                 (TyVarseq:)
                 (RECValBind:
                  (PLAINValBind:
                   (ATPat: (IDAtPat: (LongVId: delete)))
                   (FNExp:
                    (Match:
                     (Mrule:
                      (ATPat:
                       (PARAtPat:
                        (ATPat:
                         (RECORDAtPat:
                          (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: m))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: k)))))))))
                      (HANDLEExp:
                       (ATExp:
                        (PARAtExp:
                         (APPExp:
                          (ATExp:
                           (PARAtExp:
                            (FNExp:
                             (Match:
                              (Mrule:
                               (ATPat: (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: _id16))) (DOTSPatRow:))))
                               (ATExp: (IDAtExp: (LongVId: _id16))))))))
                          (PARAtExp:
                           (ATExp:
                            (PARAtExp:
                             (APPExp:
                              (ATExp: (IDAtExp: (LongVId: remove)))
                              (RECORDAtExp:
                               (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: m))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: k)))))))))))))
                       (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: LibBase.NotFound))) (ATExp: (IDAtExp: (LongVId: m)))))))))))))
               (SEQStrDec:
                (DECStrDec:
                 (VALDec:
                  (TyVarseq:)
                  (RECValBind:
                   (PLAINValBind:
                    (ATPat: (IDAtPat: (LongVId: difference)))
                    (FNExp:
                     (Match:
                      (Mrule:
                       (ATPat:
                        (PARAtPat:
                         (ATPat:
                          (RECORDAtPat:
                           (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: m))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: n)))))))))
                       (ATExp:
                        (PARAtExp:
                         (APPExp:
                          (ATExp:
                           (PARAtExp:
                            (APPExp:
                             (ATExp: (IDAtExp: (LongVId: filteri)))
                             (PARAtExp:
                              (FNExp:
                               (Match:
                                (Mrule:
                                 (ATPat:
                                  (RECORDAtPat:
                                   (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: k))) (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))
                                 (ATExp:
                                  (PARAtExp:
                                   (APPExp:
                                    (ATExp: (IDAtExp: (LongVId: not)))
                                    (PARAtExp:
                                     (ATExp:
                                      (PARAtExp:
                                       (APPExp:
                                        (ATExp: (IDAtExp: (LongVId: inDomain)))
                                        (RECORDAtExp:
                                         (ExpRow:
                                          (Lab: |1|)
                                          (ATExp: (IDAtExp: (LongVId: n)))
                                          (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: k))))))))))))))))))))
                          (IDAtExp: (LongVId: m))))))))))))
                (SEQStrDec:
                 (DECStrDec:
                  (VALDec:
                   (TyVarseq:)
                   (RECValBind:
                    (PLAINValBind:
                     (ATPat: (IDAtPat: (LongVId: all)))
                     (FNExp:
                      (Match:
                       (Mrule:
                        (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: p)))))
                        (ATExp:
                         (PARAtExp:
                          (APPExp:
                           (ATExp:
                            (PARAtExp:
                             (APPExp:
                              (ATExp: (IDAtExp: (LongVId: foldl)))
                              (PARAtExp:
                               (FNExp:
                                (Match:
                                 (Mrule:
                                  (ATPat:
                                   (RECORDAtPat:
                                    (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: v))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: b)))))))
                                  (IFExp:
                                   (ATExp: (IDAtExp: (LongVId: b)))
                                   (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: p))) (IDAtExp: (LongVId: v)))))
                                   (ATExp: (IDAtExp: (LongVId: false)))))))))))
                           (IDAtExp: (LongVId: true))))))))))))
                 (SEQStrDec:
                  (DECStrDec:
                   (VALDec:
                    (TyVarseq:)
                    (RECValBind:
                     (PLAINValBind:
                      (ATPat: (IDAtPat: (LongVId: exists)))
                      (FNExp:
                       (Match:
                        (Mrule:
                         (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: p)))))
                         (ATExp:
                          (PARAtExp:
                           (APPExp:
                            (ATExp:
                             (PARAtExp:
                              (APPExp:
                               (ATExp: (IDAtExp: (LongVId: foldl)))
                               (PARAtExp:
                                (FNExp:
                                 (Match:
                                  (Mrule:
                                   (ATPat:
                                    (RECORDAtPat:
                                     (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: v))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: b)))))))
                                   (IFExp:
                                    (ATExp: (IDAtExp: (LongVId: b)))
                                    (ATExp: (IDAtExp: (LongVId: true)))
                                    (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: p))) (IDAtExp: (LongVId: v)))))))))))))
                            (IDAtExp: (LongVId: false))))))))))))
                  (SEQStrDec:
                   (DECStrDec:
                    (VALDec:
                     (TyVarseq:)
                     (RECValBind:
                      (PLAINValBind:
                       (ATPat: (IDAtPat: (LongVId: alli)))
                       (FNExp:
                        (Match:
                         (Mrule:
                          (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: p)))))
                          (ATExp:
                           (PARAtExp:
                            (APPExp:
                             (ATExp:
                              (PARAtExp:
                               (APPExp:
                                (ATExp: (IDAtExp: (LongVId: foldli)))
                                (PARAtExp:
                                 (FNExp:
                                  (Match:
                                   (Mrule:
                                    (ATPat:
                                     (RECORDAtPat:
                                      (FIELDPatRow:
                                       (Lab: |1|)
                                       (ATPat: (IDAtPat: (LongVId: k)))
                                       (FIELDPatRow:
                                        (Lab: |2|)
                                        (ATPat: (IDAtPat: (LongVId: v)))
                                        (FIELDPatRow: (Lab: |3|) (ATPat: (IDAtPat: (LongVId: b))))))))
                                    (IFExp:
                                     (ATExp: (IDAtExp: (LongVId: b)))
                                     (ATExp:
                                      (PARAtExp:
                                       (APPExp:
                                        (ATExp: (IDAtExp: (LongVId: p)))
                                        (RECORDAtExp:
                                         (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: k))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: v)))))))))
                                     (ATExp: (IDAtExp: (LongVId: false)))))))))))
                             (IDAtExp: (LongVId: true))))))))))))
                   (SEQStrDec:
                    (DECStrDec:
                     (VALDec:
                      (TyVarseq:)
                      (RECValBind:
                       (PLAINValBind:
                        (ATPat: (IDAtPat: (LongVId: existsi)))
                        (FNExp:
                         (Match:
                          (Mrule:
                           (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: p)))))
                           (ATExp:
                            (PARAtExp:
                             (APPExp:
                              (ATExp:
                               (PARAtExp:
                                (APPExp:
                                 (ATExp: (IDAtExp: (LongVId: foldli)))
                                 (PARAtExp:
                                  (FNExp:
                                   (Match:
                                    (Mrule:
                                     (ATPat:
                                      (RECORDAtPat:
                                       (FIELDPatRow:
                                        (Lab: |1|)
                                        (ATPat: (IDAtPat: (LongVId: k)))
                                        (FIELDPatRow:
                                         (Lab: |2|)
                                         (ATPat: (IDAtPat: (LongVId: v)))
                                         (FIELDPatRow: (Lab: |3|) (ATPat: (IDAtPat: (LongVId: b))))))))
                                     (IFExp:
                                      (ATExp: (IDAtExp: (LongVId: b)))
                                      (ATExp: (IDAtExp: (LongVId: true)))
                                      (ATExp:
                                       (PARAtExp:
                                        (APPExp:
                                         (ATExp: (IDAtExp: (LongVId: p)))
                                         (RECORDAtExp:
                                          (ExpRow:
                                           (Lab: |1|)
                                           (ATExp: (IDAtExp: (LongVId: k)))
                                           (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: v)))))))))))))))))
                              (IDAtExp: (LongVId: false))))))))))))
                    (DECStrDec:
                     (VALDec:
                      (TyVarseq:)
                      (RECValBind:
                       (PLAINValBind:
                        (ATPat: (IDAtPat: (LongVId: disjoint)))
                        (FNExp:
                         (Match:
                          (Mrule:
                           (ATPat:
                            (PARAtPat:
                             (ATPat:
                              (RECORDAtPat:
                               (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: m1))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: m2)))))))))
                           (ATExp:
                            (PARAtExp:
                             (APPExp:
                              (ATExp: (IDAtExp: (LongVId: isEmpty)))
                              (PARAtExp:
                               (ATExp:
                                (PARAtExp:
                                 (APPExp:
                                  (ATExp:
                                   (PARAtExp:
                                    (APPExp:
                                     (ATExp: (IDAtExp: (LongVId: intersectWith)))
                                     (PARAtExp:
                                      (FNExp:
                                       (Match:
                                        (Mrule:
                                         (ATPat: (RECORDAtPat: (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: _id17))) (DOTSPatRow:))))
                                         (ATExp: (IDAtExp: (LongVId: _id17))))))))))
                                  (RECORDAtExp:
                                   (ExpRow:
                                    (Lab: |1|)
                                    (ATExp: (IDAtExp: (LongVId: m1)))
                                    (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: m2))))))))))))))))))))))))))))))))
        (WHERETYPESigExp: (IDSigExp: (SigId: FIN_MAP-sig)) (TyVarseq:) (LongTyCon: Key.ord_key-type) (CONTy: (Tyseq:) (LongTyCon: Key.ord_key-type))))))))))