I'm not sure how the "If" got there.
But to say more, consider your function:
(: dual-* (∀ (N) (→ (Dual-Number N) (Dual-Number N) (→ N N N) (→ N N
N) (Dual-Number N))))
(define (dual-* d1 d2 * +)
(cond
[(D? d1)
(D
(D-real d1)
(D-dual d1))]
[else (D d1 d1)]))
Now you imagine instantiating `N` with things like `(Vector3 Real)`,
but if we instantiated it instead with `(Dual-Number String)`, then
you'd have a problem.
Sam
On Mon, Feb 5, 2018 at 5:50 PM, HiPhish <[email protected]> wrote:
> Did your email get cut off?
>
> On Monday, February 5, 2018 at 6:00:05 PM UTC+1, Sam Tobin-Hochstadt wrote:
>>
>> This is an unfortunately common pitfall -- if you instantiated N with
>> something that includes a dual number, then the type error would be pointing
>> to a real bug. If
>>
>> Sam
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.