Hello,
I'm new to racket, and even more with typed/racket.
I play a little with the "Any" type (due to 'dynamic-require' which
return Any), and I'm not able to cast them back in a function.
I (over) simplify my question with this little program :
```
(: p Any)
(define (p i) (displayln i))
Maybe do you want `require/typed`?
See:
https://docs.racket-lang.org/ts-guide/typed-untyped-interaction.html#%28part._.Using_.Untyped_.Code_from_.Typed_.Code%29
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group
Have you considered organizing your program as follows:
#lang racket
(module a racket
(provide f)
(define (f x) 10))
(module b racket
(provide g)
(define g (dynamic-require '(submod "foo.rkt" a) 'f)))
(module c typed/racket
(require/typed (submod ".." b) [g (-> Integer Integer)])
Hello,
First thank Greg and Mathias for looking at my problem.
And yes, the proposed solution is working! I didn't think at all by
putting a "module in the middle", to by-pass my cast operation.
Thank you!
Denis
On 04/16/2018 04:01 PM, Matthias Felleisen wrote:
Have you considered organizi
This is interesting. The `Any` type in Typed Racket includes values that may
have higher-order "original" types. For example, it may have originally been a
typed function (-> Fixnum Fixnum) or (-> String Boolean), such that if you call
it without a contract guarding it, it should be an error. Th
Hello,
I continue my work with Typed/Racket and Racket, and I now have another
problem, with the same error.
I try to use in untyped racket a typed async-channel of type Any, and I'm not
able to use the higher-order value from this channel.
Here is an example code that show this problem :
```
Unfortunatly, not.
I'm building a framework were the user will send data over the
async-channel, so I didn't know the type in advance, and cannot specify
more the async-channel...
On 04/20/2018 02:50 PM, Sam Tobin-Hochstadt wrote:
Can you give a more specific type to what you send on the chann
Can you move the communication into an untyped submodule and use external type
specs to move the values into the typed world? We could learn from this what’s
missing from Typed Racket.
> On Apr 20, 2018, at 10:14 AM, mailoo wrote:
>
> Unfortunatly, not.
> I'm building a framework were the
In that case, which side is not typed? If the user side isn't typed,
then you can _read_ things of type `Any` from the channel just fine.
Sam
On Fri, Apr 20, 2018 at 10:14 AM, mailoo wrote:
> Unfortunatly, not.
> I'm building a framework were the user will send data over the
> async-channel, so
The untyped world will read and write... The typed world surround this
actions (async-channel-put and async-channel-get) by other things.
I want my framework Typed and using it untyped, but it seems hard to manage!
But beside, thank you for looking at my problem!
On 04/20/2018 05:41 PM, Sam To
Probably better to revert back to untyped racket for the meantime...
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
F
11 matches
Mail list logo