move definition of primitive base types
This commit is contained in:
parent
97b3a9a0b5
commit
1bdb9b7820
|
@ -207,7 +207,7 @@
|
|||
(define-type-constructor Spawns #:arity >= 0)
|
||||
|
||||
|
||||
(define-base-types Int Bool String Discard ★/t FacetName ByteString Symbol)
|
||||
(define-base-types Discard ★/t FacetName)
|
||||
|
||||
(define-for-syntax (type-eval t)
|
||||
((current-type-eval) t))
|
||||
|
@ -262,7 +262,18 @@
|
|||
#'(~→ ty-in ... (~Computation (~Value ty-out)
|
||||
(~Endpoints)
|
||||
(~Roles)
|
||||
(~Spawns)))]))))
|
||||
(~Spawns)))])))
|
||||
|
||||
;; matching possibly polymorphic types
|
||||
(define-syntax ~?∀
|
||||
(pattern-expander
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
[(?∀ vars-pat body-pat)
|
||||
#'(~or (~∀ vars-pat body-pat)
|
||||
(~and (~not (~∀ _ _))
|
||||
(~parse vars-pat #'())
|
||||
body-pat))])))))
|
||||
|
||||
;; for looking at the "effects"
|
||||
(begin-for-syntax
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
(require "core-types.rkt")
|
||||
(require (only-in "list.rkt" List))
|
||||
(require (only-in "prim.rkt" Int Bool))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Immutable Hash Tables
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
reverse)
|
||||
|
||||
(require "core-types.rkt")
|
||||
(require (only-in "prim.rkt" Bool))
|
||||
(require (postfix-in - racket/list))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
;; Primitives
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-base-types Int Bool String ByteString Symbol)
|
||||
|
||||
;; hmmm
|
||||
(define-primop + (→ Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))
|
||||
(define-primop - (→ Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
;; Start dataspace programs
|
||||
run-ground-dataspace
|
||||
;; Types
|
||||
Int Bool String Tuple Bind Discard → ∀ ByteString Symbol
|
||||
Tuple Bind Discard → ∀
|
||||
Role Reacts Shares Know ¬Know Message OnDataflow Stop OnStart OnStop
|
||||
FacetName Field ★/t
|
||||
Observe Inbound Outbound Actor U
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
(require "core-types.rkt")
|
||||
(require (only-in "list.rkt" List))
|
||||
(require (only-in "set.rkt" Set))
|
||||
(require (only-in "prim.rkt" Int Bool))
|
||||
#;(require (postfix-in - racket/sequence))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -14,13 +14,15 @@
|
|||
set->list)
|
||||
|
||||
(require "core-types.rkt")
|
||||
(require (only-in "prim.rkt" Int))
|
||||
(require (only-in "list.rkt" ~List))
|
||||
|
||||
(require (postfix-in - racket/set))
|
||||
|
||||
(module+ test
|
||||
(require rackunit)
|
||||
(require rackunit/turnstile))
|
||||
(require rackunit/turnstile)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Sets
|
||||
|
|
Loading…
Reference in New Issue