Problem with typeclasses blog post #352
-
I was reading through the blog post on typeclasses but ran into a problem with the (cl:defpackage :coalton-typeclasses
(:use :coalton :coalton-library))
(cl:in-package :coalton-typeclasses)
(coalton-toplevel
(define-type Translation (Trans Single-Float Single-Float))
(declare distance (Translation -> Single-Float))
(define (distance t)
(match t
((Trans dx dy) (cl:sqrt (+ (* dx dx) (* dy dy))))))) It give the same error when replacing the |
Beta Was this translation helpful? Give feedback.
Answered by
stylewarning
Jan 3, 2022
Replies: 1 comment
-
Sorry, sqrt isn't in the standard library. Add this above the
I'm not exactly sure where sqrt should go in the standard library yet. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, sqrt isn't in the standard library. Add this above the
distance
definition:I'm not exactly sure where sqrt should go in the standard library yet.