2009/10/19 10

if...else... 조건문 사용 예제 for Haskell

소스 파일명: testIf.py {-# Filename: testIf.hs Purpose: Example using the conditional control structure syntax if .... else ... then ... Execute: runhugs testIf.hs [number] Or runhaskell testIf.hs [number] #-} module Main where import System.Environment -- 사용법을 보여주는 함수 printUsing :: IO () printUsing = do putStrLn "Using: runhugs testIf.hs [number]" putStrLn "This determines whether the number is posi..

명령형 프로그래밍 언어와 선언형 프로그래밍 언어의 비교

명령형 언어는 "어떤(how) 방법"으로 해결할 것인가에 중점을 두지만, 선언형 언어는 "무엇(what)"을 할 것인가에 중점을 둔다. Wikiclone에서 찾아본 명령형(impertarive) 프로그래밍 언어와 선언형(declarative) 프로그래밍 언어 명령형 프로그래밍 언어의 종류: C, C++, Java, C#, SmallTalk, FORTRAN, Pascal, BASIC, Python, Ruby, Perl, PHP, Groovy, ...... 선언형 프로그래밍 언어의 종류: Lisp, Haskell, ML, Prolog, SQL, XSL, ......