(module Fifo-struct (planet chongkai/sml) (#%module-begin (Program: (STRDECTopDec: (STRUCTUREStrDec: (StrBind: (StrId: Fifo-struct) (COLONStrExp: (STRUCTStrExp: (SEQStrDec: (DECStrDec: (DATATYPEDec: (DatBind: (TyVarseq: (TyVar: |'a|)) (TyCon: fifo-type) (ConBind: (VId: Q) (RECORDTy: (TyRow: (Lab: front) (CONTy: (Tyseq: (VARTy: (TyVar: |'a|))) (LongTyCon: list-type)) (TyRow: (Lab: rear) (CONTy: (Tyseq: (VARTy: (TyVar: |'a|))) (LongTyCon: list-type))))))))) (SEQStrDec: (DECStrDec: (EXCEPTIONDec: (NEWExBind: (VId: Dequeue)))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (PLAINValBind: (ATPat: (IDAtPat: (LongVId: empty))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Q))) (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (IDAtExp: (LongVId: nil))) (ExpRow: (Lab: rear) (ATExp: (IDAtExp: (LongVId: nil)))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: isEmpty))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: nil))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: nil))))))))))))) (ATExp: (IDAtExp: (LongVId: true)))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (WILDCARDAtPat:)))) (ATExp: (IDAtExp: (LongVId: false))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: enqueue))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: x))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Q))) (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (IDAtExp: (LongVId: front))) (ExpRow: (Lab: rear) (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: ::))) (RECORDAtExp: (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: x))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: rear)))))))))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: dequeue))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: ::) (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: hd))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: tl))))))))))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))))))))) (ATExp: (RECORDAtExp: (ExpRow: (Lab: |1|) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Q))) (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (IDAtExp: (LongVId: tl))) (ExpRow: (Lab: rear) (ATExp: (IDAtExp: (LongVId: rear))))))))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: hd)))))))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: nil))) (DOTSPatRow:)))))))))) (RAISEExp: (ATExp: (IDAtExp: (LongVId: Dequeue))))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))) (DOTSPatRow:)))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: dequeue))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Q))) (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: rev))) (IDAtExp: (LongVId: rear))))) (ExpRow: (Lab: rear) (ATExp: (IDAtExp: (LongVId: nil)))))))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: delete))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: pred))))))))) (ATExp: (LETAtExp: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: doFront))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: nil))))) (ATExp: (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: doRear))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: rev))) (IDAtExp: (LongVId: rear))))))))) (ExpRow: (Lab: rear) (ATExp: (IDAtExp: (LongVId: nil)))))))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: ::) (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: x))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: r))))))))))))) (IFExp: (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: pred))) (IDAtExp: (LongVId: x))))))) (ATExp: (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (IDAtExp: (LongVId: r))) (ExpRow: (Lab: rear) (ATExp: (IDAtExp: (LongVId: rear))))))) (ATExp: (LETAtExp: (VALDec: (TyVarseq:) (PLAINValBind: (ATPat: (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: doFront))) (IDAtExp: (LongVId: r))))))) (ATExp: (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: ::))) (RECORDAtExp: (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: x))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: front))))))))) (ExpRow: (Lab: rear) (ATExp: (IDAtExp: (LongVId: rear)))))))))))))) (PLAINValBind: (ATPat: (IDAtPat: (LongVId: doRear))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: nil))))) (ATExp: (IDAtExp: (LongVId: nil)))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: ::) (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: x))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: r))))))))))))) (IFExp: (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: pred))) (IDAtExp: (LongVId: x))))))) (ATExp: (IDAtExp: (LongVId: r))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: ::))) (RECORDAtExp: (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: x))) (ExpRow: (Lab: |2|) (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: doRear))) (IDAtExp: (LongVId: r)))))))))))))))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Q))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: doFront))) (IDAtExp: (LongVId: front)))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: peek))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: ::) (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: hd))) (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:)))))))))) (DOTSPatRow:)))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: SOME))) (IDAtExp: (LongVId: hd)))))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: nil))) (DOTSPatRow:)))))))))) (ATExp: (IDAtExp: (LongVId: NONE)))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))) (DOTSPatRow:)))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: SOME))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: hd))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: rev))) (IDAtExp: (LongVId: rear)))))))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: head))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: ::) (RECORDAtPat: (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: hd))) (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:)))))))))) (DOTSPatRow:)))))))))) (ATExp: (IDAtExp: (LongVId: hd)))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: nil))) (DOTSPatRow:)))))))))) (RAISEExp: (ATExp: (IDAtExp: (LongVId: Dequeue))))) (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))) (DOTSPatRow:)))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: hd))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: rev))) (IDAtExp: (LongVId: rear)))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: length))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))) (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))))))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: +))) (RECORDAtExp: (ExpRow: (Lab: |1|) (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.length))) (IDAtExp: (LongVId: rear))))))) (ExpRow: (Lab: |2|) (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.length))) (IDAtExp: (LongVId: front)))))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: contents))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))) (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))))))))))))) (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: @))) (RECORDAtExp: (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: front))) (ExpRow: (Lab: |2|) (ATExp: (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: rev))) (IDAtExp: (LongVId: rear)))))))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: app))) (FNExp: (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: f))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))))))) (ATExp: (SEQAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.app))) (IDAtExp: (LongVId: f))))) (IDAtExp: (LongVId: front))))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.app))) (IDAtExp: (LongVId: f))))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.rev))) (IDAtExp: (LongVId: rear)))))))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: map))) (FNExp: (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: f))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Q))) (RECORDAtExp: (ExpRow: (Lab: front) (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.map))) (IDAtExp: (LongVId: f))))) (IDAtExp: (LongVId: front))))) (ExpRow: (Lab: rear) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: rev))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.map))) (IDAtExp: (LongVId: f))))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: rev))) (IDAtExp: (LongVId: rear))))))))))))))))))))))))))))) (SEQStrDec: (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: foldl))) (FNExp: (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: f))) (FNExp: (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: b))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.foldr))) (IDAtExp: (LongVId: f))))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.foldl))) (IDAtExp: (LongVId: f))))) (IDAtExp: (LongVId: b))))) (IDAtExp: (LongVId: front))))))))) (IDAtExp: (LongVId: rear)))))))))))))))))) (DECStrDec: (VALDec: (TyVarseq:) (RECValBind: (PLAINValBind: (ATPat: (IDAtPat: (LongVId: foldr))) (FNExp: (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: f))) (FNExp: (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: b))) (FNExp: (Match: (Mrule: (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: Q) (RECORDAtPat: (FIELDPatRow: (Lab: front) (ATPat: (IDAtPat: (LongVId: front))) (FIELDPatRow: (Lab: rear) (ATPat: (IDAtPat: (LongVId: rear))))))))))) (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.foldr))) (IDAtExp: (LongVId: f))))) (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: List.foldl))) (IDAtExp: (LongVId: f))))) (IDAtExp: (LongVId: b))))) (IDAtExp: (LongVId: rear))))))))) (IDAtExp: (LongVId: front))))))))))))))))))))))))))))))))) (IDSigExp: (SigId: FIFO-sig)))))))))