leankg 0.20.4

Lightweight Knowledge Graph for AI-Assisted Development
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Geometry where

import Data.List (sort)

double :: Int -> Int
double x = x * 2

area :: Int -> Int -> Int
area w h = w * h

class Shape a where
  perimeter :: a -> Double

data Circle = Circle { radius :: Double }

instance Shape Circle where
  perimeter (Circle r) = 2 * pi * r