系列: haskell
haskell
15 行
· 更新于 2026-02-03
exercise_2.hs
haskell/Week_6_Lab/exercise_2.hs
-- Part of Exercise 2
-- Define a custom myMap function
myMap :: (a -> b) -> [a] -> [b]
myMap _ [] = []
myMap f (x:xs) = (f x) : myMap f xs
-- Re-define the functions using myMap
incAll :: [Integer] -> [Integer]
incAll = myMap (+1)
negateAll :: [Bool] -> [Bool]
negateAll = myMap not
isLeast100All :: [Integer] -> [Bool]
isLeast100All = myMap (>= 100)
相关文章
haskell
haskell
更新于 2026-02-03
Adding.hs
Adding.hs — haskell source code from the haskell learning materials (haskell/Adding.hs).
阅读文章 →
haskell
haskell
更新于 2026-02-03
Area.hs
Area.hs — haskell source code from the haskell learning materials (haskell/Area.hs).
阅读文章 →
haskell
haskell
更新于 2026-02-03
Chess.hs
Chess.hs — haskell source code from the haskell learning materials (haskell/Chess.hs).
阅读文章 →
haskell
haskell
更新于 2026-02-03
ChessGraphics.hs
ChessGraphics.hs — haskell source code from the haskell learning materials (haskell/ChessGraphics.hs).
阅读文章 →
haskell
haskell
更新于 2026-02-03
Examples.hs
Examples.hs — haskell source code from the haskell learning materials (haskell/Examples.hs).
阅读文章 →
haskell
haskell
更新于 2026-02-03
Fibonacci.hs
Fibonacci.hs — haskell source code from the haskell learning materials (haskell/Fibonacci.hs).
阅读文章 →