hamlet/Stream-struct.ss
(module Stream-struct (planet chongkai/sml)
  (#%module-begin
   (Program:
    (STRDECTopDec:
     (STRUCTUREStrDec:
      (StrBind:
       (StrId: Stream-struct)
       (SEALStrExp:
        (STRUCTStrExp:
         (SEQStrDec:
          (DECStrDec:
           (DATATYPEDec:
            (DatBind:
             (TyVarseq: (TyVar: |'a|))
             (TyCon: str-type)
             (ConBind:
              (VId: EVAL)
              (RECORDTy:
               (TyRow:
                (Lab: |1|)
                (VARTy: (TyVar: |'a|))
                (TyRow: (Lab: |2|) (CONTy: (Tyseq: (CONTy: (Tyseq: (VARTy: (TyVar: |'a|))) (LongTyCon: str-type))) (LongTyCon: ref-type)))))
              (ConBind: (VId: UNEVAL) (PARTy: (ARROWTy: (CONTy: (Tyseq:) (LongTyCon: unit-type)) (VARTy: (TyVar: |'a|)))))))))
          (SEQStrDec:
           (DECStrDec:
            (TYPEDec:
             (TypBind:
              (TyVarseq: (TyVar: |'a|))
              (TyCon: stream-type)
              (CONTy: (Tyseq: (CONTy: (Tyseq: (VARTy: (TyVar: |'a|))) (LongTyCon: str-type))) (LongTyCon: ref-type)))))
           (SEQStrDec:
            (DECStrDec:
             (VALDec:
              (TyVarseq:)
              (RECValBind:
               (PLAINValBind:
                (ATPat: (IDAtPat: (LongVId: get)))
                (FNExp:
                 (Match:
                  (Mrule:
                   (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: s)))))
                   (APPExp:
                    (ATExp:
                     (PARAtExp:
                      (FNExp:
                       (Match:
                        (Mrule: (ATPat: (PARAtPat: (CONPat: (LongVId: EVAL) (IDAtPat: (LongVId: t))))) (ATExp: (IDAtExp: (LongVId: t))))
                        (Match:
                         (Mrule:
                          (ATPat: (PARAtPat: (CONPat: (LongVId: UNEVAL) (IDAtPat: (LongVId: f)))))
                          (ATExp:
                           (LETAtExp:
                            (VALDec:
                             (TyVarseq:)
                             (PLAINValBind:
                              (ATPat: (IDAtPat: (LongVId: t)))
                              (ATExp:
                               (RECORDAtExp:
                                (ExpRow:
                                 (Lab: |1|)
                                 (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: f))) (RECORDAtExp:))))
                                 (ExpRow:
                                  (Lab: |2|)
                                  (ATExp:
                                   (PARAtExp:
                                    (APPExp:
                                     (ATExp: (IDAtExp: (LongVId: ref)))
                                     (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: UNEVAL))) (IDAtExp: (LongVId: f)))))))))))))))
                            (ATExp:
                             (SEQAtExp:
                              (ATExp:
                               (PARAtExp:
                                (APPExp:
                                 (ATExp: (IDAtExp: (LongVId: :=)))
                                 (RECORDAtExp:
                                  (ExpRow:
                                   (Lab: |1|)
                                   (ATExp: (IDAtExp: (LongVId: s)))
                                   (ExpRow: (Lab: |2|) (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: EVAL))) (IDAtExp: (LongVId: t)))))))))))
                              (PARAtExp: (ATExp: (IDAtExp: (LongVId: t))))))))))))))
                    (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: !))) (IDAtExp: (LongVId: s))))))))))))))
            (SEQStrDec:
             (DECStrDec:
              (VALDec:
               (TyVarseq:)
               (RECValBind:
                (PLAINValBind:
                 (ATPat: (IDAtPat: (LongVId: streamify)))
                 (FNExp:
                  (Match:
                   (Mrule:
                    (ATPat: (PARAtPat: (ATPat: (IDAtPat: (LongVId: f)))))
                    (ATExp:
                     (PARAtExp:
                      (APPExp:
                       (ATExp: (IDAtExp: (LongVId: ref)))
                       (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: UNEVAL))) (IDAtExp: (LongVId: f))))))))))))))))
             (DECStrDec:
              (VALDec:
               (TyVarseq:)
               (RECValBind:
                (PLAINValBind:
                 (ATPat: (IDAtPat: (LongVId: cons)))
                 (FNExp:
                  (Match:
                   (Mrule:
                    (ATPat:
                     (PARAtPat:
                      (ATPat:
                       (RECORDAtPat:
                        (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: a))) (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: s)))))))))
                    (ATExp:
                     (PARAtExp:
                      (APPExp:
                       (ATExp: (IDAtExp: (LongVId: ref)))
                       (PARAtExp:
                        (ATExp:
                         (PARAtExp:
                          (APPExp:
                           (ATExp: (IDAtExp: (LongVId: EVAL)))
                           (RECORDAtExp:
                            (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: a))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: s)))))))))))))))))))))))))
        (IDSigExp: (SigId: STREAM-sig)))))))))