What happens if you provide the data structure from Typed Racket and
require it in an untyped module?
On 5/17/19, bruno cuconato wrote:
> hi,
>
> I'm trying to use a data structure defined in a typed racket module in my
> untyped code.
>
> I'm want it to be accessible from a generic interface, so
hi,
I'm trying to use a data structure defined in a typed racket module in my
untyped code.
I'm want it to be accessible from a generic interface, so I'm using
`define-generics`'s #:fast-defaults for
dispatching to the proper methods (this might not be the best practice
though, and if so I wel
One other suggestion: you can use `define-predicate` in a Typed Racket
module to create a predicate for any type that can be checked
immediately. So
```
(define-predicate dist? (Discrete-Dist Your-Type-Here))
```
should define the predicate you want.
Sam
On Fri, Jul 28, 2017 at 10:23 AM, James
> On Jul 31, 2017, at 5:27 AM, James Geddes wrote:
>
>
> Matthias,
>
> Thank you, that's really helpful, both for letting me know I'm not being an
> idiot (always welcome!) and for the example code, which makes me realise I
> should learn about exceptions next.
>
> Many thanks again,
>
>
Matthias,
Thank you, that's really helpful, both for letting me know I'm not being an
idiot (always welcome!) and for the example code, which makes me realise I
should learn about exceptions next.
Many thanks again,
James
---
James Geddes
--
You received this m
After some poking around, here is what I can offer:
#lang racket
(module predicates racket
(provide discrete-dist-thing?)
;; -
;; dependencies
(require math/distributions)
;; -
;; implementation
(define (discrete
> On Jul 28, 2017, at 11:23 AM, James Geddes wrote:
>
> This is likely a typed-untyped interface newbie question.
>
> Briefly, how can I write a contract that asserts that some value has a type
> that is defined in an imported typed/racket library?
>
> In more detail, I am using the math/dist
7 matches
Mail list logo