系列: haskell
haskell
8 行
· 更新於 2026-02-03
exercise_5_1.hs
haskell/Week_6_Lab/exercise_5_1.hs
-- Define the unMaybe function
unMaybe :: [Maybe a] -> [a]
unMaybe [] = [] -- Base case: empty list returns an empty list
unMaybe (x:xs) =
case x of
Just value -> value : unMaybe xs -- If the element is Just, extract the value and continue
Nothing -> unMaybe xs -- If the element is Nothing, skip it and continue
相關文章
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).
閱讀文章 →