I don’t think you can. You would need define the struct in an untyped module
then require it via require/typed. This is why dict’s don’t work in
typed/racket either.
On Sat, May 24, 2014 at 9:39 PM, Alexander D. Knauth
wrote:
> Do generic interfaces work using structure type properties, and if
It took me a while of reading through the docs to figure out why trying to
install a package via "https://github.com/user/pkg"; failed for want of a
MANIFEST file. I think the "do what I mean" installer should have
autoconverted it to git:// , seeing as how github is already special-cased.
(Also m
Dredging up an old thread: So how exactly do you define custom-write for
a typed racket struct?
On 05/25/2014 03:30 PM, Alexander D. Knauth wrote:
> Never mind I just found prop:dict.
>
> By the way it would probably be helpful if instead of the value for
> prop:dict being a vector, it was a hash
Hi George,
I suggest that all Racket web-server apps not use the dynamic features
of serve/servlet either, but instead write the servlet as the single
"request -> response" function that serve/servlet provides. This would
ensure that all the libraries are loaded the one time and has the best
perfo
Sure, I can make a post about it. However, the core idea is already in
this post:
http://jeapostrophe.github.io/2012-07-12-cont-sys-post.html
I can make another one, however, to rehash it and talk about the
benefits of monoid states.
Jay
On Fri, Sep 26, 2014 at 2:15 PM, Michael Bradley, Jr.
wr
Is it possible to have a struct that does certain things according to the guard?
#lang typed/racket
(struct (a) foo ([a : a]) #:transparent
#:guard (lambda (a _)
(unless (exact-integer? a)
(error 'foo "expected Integer, given ~v" a))
a))
(ann (foo (ann 1 An
Jay McCarthy writes:
>
> I've just released the game architecture library I talked about in
> part 2 of my RacketCon talk.
>
> The big picture of this library is to make World-style programs more
> compositional by (a) using continuations to hide the internal state
> (including control state)
Does using andmap with the custom predicates you alluded to for that union
you mentioned work?
Something like this perhaps?:
#lang typed/racket
(struct: T1 ())
(struct: T2 ())
(define-type T1or2 (U T1 T2))
(: T1or2? (-> Any Boolean : T1or2))
(define (T1or2? a)
(or (T1? a) (T2? a)))
(: listo
Andrew Kent writes:
> Will andmap work for you?
Interesting... I didn't know about that one.
For my demonstration code, that's indeed a good solution. In my real
application, the test is more complicated. I need to check all
elements of a list for conformance to a union type, so I have no
prefa
Will andmap work for you?
(struct: foo ())
(struct: bar ())
(define-type FooOrBar (U foo bar))
(: f-bar (-> (Listof bar) Void))
(define (f-bar xs)
(void))
(: f-mixed (-> (Listof FooOrBar) Void))
(define (f-mixed xs)
(void))
(: f (-> (Listof FooOrBar) Void))
Hi everyone,
I am trying to convince Typed Racket that after a run-time check on
some list, its elements are all of a given type. This is just like
occurrence typing based on a predicate, except that my predicate
is more complicated.
My first attempt was this:
#lang typed/racket
(struct:
11 matches
Mail list logo