Files
eth-summaries/semester4/fmfp/code/00_syntax.hs
2026-02-27 17:11:45 +01:00

12 lines
331 B
Haskell

-- Declaring a function. Naming using lowerCamelCase
-- Arguments separated by whitespace
myFunc :: Int -> Int -> Int
myFunc x y
| x > 0 = x + y
| x < 0 = -x + y
-- On compile the above function is transformed like this:
-- TODO: Transform the template into correct version
myFuncXCompiled :: Int -> Int
myFuncXCompiled x = x