随笔分类 - 04.Functional Prog
Haskell
摘要:摘自{-逆波兰式(revese polish notation, RPN): 操作符出现在操作数的后面,而不是夹在它们中间. 如我们使用 "4 3 +" 而不是 "4 + 3".-}solveRPN :: String -> DoublesolveRPN = head . foldl folding...
阅读全文
摘要:doubleMe x = x + xdoubleUs x y = doubleMe x + doubleMe ydoubleSmallNumber x = if x>100 then x else x * 2 doubleSmallNumber' x =...
阅读全文
摘要:i :: Inti = 5--add, sub :: Int -> Int -> Intadd, sub :: (Num a) => a -> a -> aadd a b = a + bsub a b = a - bf :: (Num a) => a -> af x = 4 * x + 1--出错-...
阅读全文
摘要:from:http://www.haskell.org/haskellwiki/Haskell_in_5_steps#Write_your_first_parallel_Haskell_program起由: Write your first parallel Haskell programHaskell has good support for parallel and multicore programming. We can write a parallel program by adding `par` to expressions, like so:import Control.Par
阅读全文
摘要:Leksah Editor: http://leksah.org/download.html/*******************************************************************************/http://eclipsefp.github.com/Install:http://eclipsefp.github.com/install.htmlhttp://www.haskell.org/haskellwiki/Learn_Haskell_in_10_minutesAbout This ProjectEGit is an Eclips
阅读全文