V2EX  ›  英汉词典

Functor

释义 Definition

Functor(函子):数学(范畴论)和计算机科学中的概念,指一种把一个范畴中的对象与态射(映射)系统地对应到另一个范畴中的结构保持映射。通俗说:它不仅“映射东西”,还会把“关系/箭头”也一起按规则映射过去,并保持结构(如恒等态射与复合)。
在函数式编程里,Functor常指一种类型类/接口:允许你在“容器/上下文”里对值做映射(如 map/fmap),而不改变容器结构。

发音 Pronunciation

/ˈfʌŋktər/

例句 Examples

A functor maps objects and arrows from one category to another.
函子把一个范畴中的对象和“箭头”(态射)映射到另一个范畴中。

In Haskell, the Functor type class lets you apply a function to values inside a context while preserving the structure.
在 Haskell 中,Functor 类型类让你把函数作用在“上下文/容器”里的值上,同时保持结构不变。

词源 Etymology

functor由拉丁语词根 **funct-**(与“执行、履行”相关,来自 fungi)加上表示“执行者/起作用者”的后缀 -or 构成。该词在现代数学中被用作术语,强调它在不同结构之间“起作用”的映射角色,后来也被函数式编程借用并推广。

相关词 Related Words

文学与名著用例 Literary & Notable Works

  • Categories for the Working Mathematician — Saunders Mac Lane(系统讲解范畴与函子的经典教材)
  • Category Theory — Steve Awodey(入门范畴论,频繁使用并解释 functor)
  • Basic Category Theory for Computer Scientists — Benjamin C. Pierce(面向计算机科学的范畴论,讨论 functor 与程序语义)
  • Learn You a Haskell for Great Good! — Miran Lipovača(函数式编程读物,介绍 Functor/fmap 的直观用法)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   746 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 10ms · UTC 22:18 · PVG 06:18 · LAX 14:18 · JFK 17:18
♥ Do have faith in what you're doing.