toporlocal.hs 481 B

123456789101112131415
  1. module TOPORLOCAL where
  2. -- all top level scope declarations are visible to external modules
  3. -- can be read as "take an integer and return an integer"
  4. toplevelfunction :: Integer -> Integer
  5. -- tplvlfunc :: Integer -> String -> Integer
  6. -- would be read as "take an integer, a string and return an integer"
  7. toplevelfunction x =
  8. -- woot however is only locally scoped
  9. x + woot + toplevelvalue
  10. where woot :: Integer; woot = 10
  11. toplevelvalue :: Integer; toplevelvalue = 5