More Related Content
PPTX
PPTX
PDF
PDF
PDF
Data Structure - 1st Study PDF
PDF
PDF
What's hot
PDF
PDF
[SICP] 4.4 Logic Programming : 논리로 프로그램 짜기 PDF
알고리즘 연합캠프 세미나 1-C (알고리즘 설계와 모델링 및 수학) PPTX
PDF
[C++ korea] effective modern c++ study item 2 understanding auto type deduc... PDF
PPTX
불어오는 변화의 바람, From c++98 to c++11, 14 PDF
PDF
Viewers also liked
PDF
PPTX
PDF
PPTX
PPTX
PDF
PPTX
PDF
xunittestpatternchapter15 PPTX
Apprenticeship patterns chapter4 Similar to Design Pattern In Functional Language
PDF
빅데이터자료구조 Python Module Recursion -모듈-순환-최종.pdf PPTX
함수형 사고 - Functional thinking PPTX
Sicp 2.2 계층 구조 데이터와 닫힘 성질 PPTX
코딩테스트 합격자 되기 C++ 15장 동적계획법에 대한 강의자료 입니다. PDF
PDF
[SOPT] 데이터 구조 및 알고리즘 스터디 - #01 : 개요, 점근적 복잡도, 배열, 연결리스트 PDF
PPTX
PPTX
DOCX
PDF
PDF
PDF
PDF
PDF
Functional thinking - 책 리뷰 1탄 PPTX
PDF
Finding Functional Programming PPTX
PPT
String Searching Algorithms PPTX
Design Pattern In Functional Language
- 1.
- 2.
- 3.
- 4.
함수형 언어람다 대수(lambdacalculus)f(x) = x+10(λx.x+10)(λx.x+10) 32 = 32 + 10 = 42(λop.λx.(op x x)) (+) 21 = (λx.((+) x x)) 21 = (+) 21 21 = 42부수 효과(side-effect)함수 실행이 외부에 끼치는 영향.순수 함수형 언어는 부수효과가 전혀 없다. - 5.
- 6.
- 7.
- 8.
- 9.
F# Syntaxfun무명함수(람다) 정의letnums = [1; 2; 3;]let odds =List.filter (fun x -> x%2 = 1) numslet oddsSquare = List.map (fun x -> x * x) (List.filter (fun x-> x%2 = 1 ) nums) - 10.
F# Syntax|>파이프 연산자.letodds =nums |> List.filter (fun x -> x%2 = 1)let oddsSquare =nums |> List.filter (fun x -> x%2 = 1) |> List.map (fun x -> x*x)별거 아닌거 같지만 상당히 가독성을 높여준다. - 11.
- 12.
F# SyntaxPattern MatchletAreaOf shape = match shape with | Rect(pf, pt) -> rectArea(pf,pt) | Ellipse(pf,pt) -> ellipseArea(pf,pt) | Comp(Rect(p1,p2), Rect(p3,p4)) when isNested(p3,p4,p1,p2) -> rectArea(p1,p2) | Comp(s1,s2) -> let area1 = shapeArea(s1) let area2 = shapeArea(s2) area1 + area2 – (intersectArea(s1,s2)) - 13.
- 14.
- 15.
- 16.
- 17.
- 18.