Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
-- Preliminary.
-- 2011nov17
-- (find-es "haskell")
-- (find-angg ".emacs" "hugs")
-- (find-hugsbasefile "Prelude.hs")
-- (find-hugsbasefile "Prelude.hs" "Standard list functions")

plus1 x = x + 1

-- mycar :: [Int] -> Int
mycar []    = 99
mycar (a:b) = a

merge a b = merge' a b []

-- (find-hugsbasefile "Prelude.hs" "max x y")
merge' [] [] c = c
merge' (a:as) [] c = merge' as [] (c ++ [a])
merge' [] (b:bs) c = merge' [] bs (c ++ [b])
merge' (a:as) (b:bs) c | a < b     = merge' as (b:bs) (c ++ [a])
                       | otherwise = merge' (a:as) bs (c ++ [b])
  
{-
* (eepitch-hugs)
* (eepitch-kill)
* (eepitch-hugs)
:load mergesort.hs
:t merge
merge [20, 30, 40] []
merge [] [20, 30, 40]
merge [22, 24, 50] [20, 30, 40]

:t plus1
plus1 20
:t mycar
mycar [20, 30, 40]
mycar []
:t []
:t [20, 30, 40]
:?



* (eepitch-ghci)
* (eepitch-kill)
* (eepitch-ghci)
:load mergesort.hs
:t merge
merge [20, 30, 40] []
merge [] [20, 30, 40]
merge [22, 24, 50] [20, 30, 40]

-}