CS/Programming Language

ML: Higher-order Functions

WakaraNai 2022. 11. 11. 16:27
728x90
반응형

Higher-order Functions : 함수의 매개변수 또는 반환값이 n차원인 함수

ex) quick sort

 

 

Predefined Higher-order Function == builtin

Curry : Curried...

파라미터가 주어지면 연속해서 적용한다. : https://en.wikipedia.org/wiki/Currying

하나의 함수를 반복대상의 모든 원소에 적용

 

Currying - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Transforming a function in such a way that it only takes a single argument This article is about the mathematical technique. For the cooking process of this name, see Curry. For the le

en.wikipedia.org

 

map

python & ML

foldl, foldr

 

Pattern Matching

0일 때는 "zero"를 아니라면 "non-zero"를 리턴한다는 의미

함수 이름을 반복해서 적는 문법

Python의 Higher = List comprehension

List Comprehension

Practice : Merge Sort by ML

Local Vairable Declaration : let  .... in ... end

원소가 0개, 1개, n개 일 때에 대해 각각 정의 

 

소스 파일 실행하기

728x90
반응형

'CS > Programming Language' 카테고리의 다른 글

Semantic Analyzer: Polymorphism  (0) 2022.11.15
Semantics Analyzer : Type  (0) 2022.11.11
ML: Semantics - "Types", Polymorphism, Scope  (0) 2022.11.10
Language Systems  (0) 2022.11.03
모호성  (0) 2022.10.31