ex5.4.hs 363 B

123456789101112131415
  1. -- Exercise 5.4
  2. -- George C. Privon
  3. -- 2024-07-20
  4. repeatInt :: Int -> [Int]
  5. repeatInt n = n:n:n:[]
  6. -- `repeatInt` takes an input integer and returns a list of three copies of
  7. -- that integer.
  8. tripleString :: String -> [String]
  9. tripleString stng = stng:stng:stng:[]
  10. -- `tripleString` takes an input string and returns a list of three copies of
  11. -- that string.