<commit_before>#lang racket/base

;; This file provides Typed Racket bindings for values that need
;; contract protection, even in typed code.

(require "../utils/utils.rkt"
         (env init-envs)
         (types abbrev union)
         (utils any-wrap)
         (only-in (rep type-rep)
                  make-Prompt-Tagof))

;; this submodule defines the contracted versions
(module contracted racket/base
  (require racket/contract
           (rename-in
            racket/base
            [default-continuation-prompt-tag -default-continuation-prompt-tag])
           "../utils/utils.rkt"
           (utils any-wrap))

  (provide default-continuation-prompt-tag)

  ;; default tag should use Any wrappers
  (define default-continuation-prompt-tag
    (contract (-> (prompt-tag/c any-wrap/c #:call/cc any-wrap/c))
              -default-continuation-prompt-tag
              ;; TODO: we actually want to be able to specify that the
              ;;       "contract from" party is not the untyped party
              ;;       here, but that's not currently possible
              'untyped 'typed)))

(require (for-template (submod "." contracted))
         (submod "." contracted))

(provide default-continuation-prompt-tag)

;; set up the type environment
(define-initial-env initialize-contracted
  [default-continuation-prompt-tag
    (-> (make-Prompt-Tagof ManyUniv (-> ManyUniv ManyUniv)))])<commit_msg>Fix default prompt tag type<commit_after>#lang racket/base

;; This file provides Typed Racket bindings for values that need
;; contract protection, even in typed code.

(require "../utils/utils.rkt"
         (env init-envs)
         (types abbrev union)
         (utils any-wrap)
         (only-in (rep type-rep)
                  make-Prompt-Tagof))

;; this submodule defines the contracted versions
(module contracted racket/base
  (require racket/contract
           (rename-in
            racket/base
            [default-continuation-prompt-tag -default-continuation-prompt-tag])
           "../utils/utils.rkt"
           (utils any-wrap))

  (provide default-continuation-prompt-tag)

  ;; default tag should use Any wrappers
  (define default-continuation-prompt-tag
    (contract (-> (prompt-tag/c any-wrap/c #:call/cc any-wrap/c))
              -default-continuation-prompt-tag
              ;; TODO: we actually want to be able to specify that the
              ;;       "contract from" party is not the untyped party
              ;;       here, but that's not currently possible
              'untyped 'typed)))

(require (for-template (submod "." contracted))
         (submod "." contracted))

(provide default-continuation-prompt-tag)

;; set up the type environment
(define-initial-env initialize-contracted
  [default-continuation-prompt-tag
    ;; TODO: we actually want the type
    ;;       for the handler (->* (list) Univ ManyUniv)
    ;;       but the prompt tag contract doesn't quite
    ;;       support this (it needs a #:rest argument)
    ;;
    ;;       Also, this type works better with inference.
    (-> (make-Prompt-Tagof Univ (-> Univ ManyUniv)))])
{'fraction_non_alphanumeric': 0.1101421188630491, 'fraction_numerical': 0.0, 'mean_word_length': 2.3408845738942827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '820113', 'n_tokens_mistral': 919, 'n_tokens_neox': 851, 'n_words': 260}