aboutsummaryrefslogtreecommitdiff
path: root/hypsrc-test/src/Identifiers.hs
blob: 173c3ba7b322c4d25a4a024afd195c662229d6d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Identifiers where


foo, bar, baz :: Int -> Int -> Int
foo x y = x + x * bar y x * y + y
bar x y = y + x - baz x y - x + y
baz x y = x * y * y * y * x

quux :: Int -> Int
quux x = foo (bar x x) (bar x x)

norf :: Int -> Int -> Int -> Int
norf x y z
    | x < 0 = quux x
    | y < 0 = quux y
    | z < 0 = quux z
    | otherwise = norf (-x) (-y) (-z)


main :: IO ()
main = do
    putStrLn . show $ foo x y
    putStrLn . show $ quux z
    putStrLn . show $ Identifiers.norf x y z
  where
    x = 10
    y = 20
    z = 30