{-# LANGUAGE Haskell2010 #-}
module Identifiers where


foo, bar, baz :: Int -> Int -> Int
foo :: Int -> Int -> Int
foo Int
x Int
y = Int
x Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
x Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int -> Int -> Int
bar Int
y Int
x Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
y Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
y
bar :: Int -> Int -> Int
bar Int
x Int
y = Int
y Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
x Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int -> Int -> Int
baz Int
x Int
y Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
x Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
y
baz :: Int -> Int -> Int
baz Int
x Int
y = Int
x Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
y Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
y Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
y Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
x

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

norf :: Int -> Int -> Int -> Int
norf :: Int -> Int -> Int -> Int
norf Int
x Int
y Int
z
    | Int
x Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
0 = Int -> Int
quux Int
x
    | Int
y Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
0 = Int -> Int
quux Int
y
    | Int
z Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
0 = Int -> Int
quux Int
z
    | Bool
otherwise = Int -> Int -> Int -> Int
norf (-Int
x) (-Int
y) (-Int
z)


main :: IO ()
main :: IO ()
main = do
    String -> IO ()
putStrLn (String -> IO ()) -> (Int -> String) -> Int -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String
forall a. Show a => a -> String
show (Int -> IO ()) -> Int -> IO ()
forall a b. (a -> b) -> a -> b
$ Int -> Int -> Int
foo Int
x Int
y
    String -> IO ()
putStrLn (String -> IO ()) -> (Int -> String) -> Int -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String
forall a. Show a => a -> String
show (Int -> IO ()) -> Int -> IO ()
forall a b. (a -> b) -> a -> b
$ Int -> Int
quux Int
z
    String -> IO ()
putStrLn (String -> IO ()) -> (Int -> String) -> Int -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String
forall a. Show a => a -> String
show (Int -> IO ()) -> Int -> IO ()
forall a b. (a -> b) -> a -> b
$ Int -> Int -> Int -> Int
Identifiers.norf Int
x Int
y Int
z
  where
    x :: Int
x = Int
10
    y :: Int
y = Int
20
    z :: Int
z = Int
30