phc-toolkit/threading.rkt
2017-04-27 23:38:55 +02:00

23 lines
742 B
Racket

#lang typed/racket
(require "typed-untyped.rkt")
(define-typed/untyped-modules #:no-test
;; raco pkg install alexis-util
;; or:
;; raco pkg install threading
(require alexis/util/threading
(for-syntax racket/syntax
syntax/parse))
(define-syntax-rule (~>_ clause ... expr) (~> expr clause ...))
(define-syntax (<~ stx)
(syntax-parse stx
[(_ expr clause ...)
(define/with-syntax (r-clause ...)
(reverse (syntax->list #'(clause ...))))
#'(~> expr r-clause ...)]))
(define-syntax-rule (<~_ clause ... expr) (<~ expr clause ...))
(provide <~ <~_ ~>_
(rename-out [_ ] [<~_ <~♦] [~>_ ~>♦])
(all-from-out alexis/util/threading)))