Last active
June 3, 2021 19:25
-
-
Save leocavalcante/e62db4c87105e8bece4ea71feeb5186d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FiguraGeometrica a where | |
area :: a -> Int | |
data Circulo = Circulo { raio :: Int } | |
data Quadrado = Quadrado { lado :: Int } | |
instance FiguraGeometrica Circlo a where a | |
area = 3.14 * (a raio) ** 2 | |
instance FiguraGeometrica Quadrado a where a | |
area = (a lado) ** 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment