阿奇霉素治疗什么| 阴茎硬不起来吃什么药| 罗姓男孩取什么名字好| 晚上喝什么茶有助于睡眠| fwb是什么意思| 黄绿色痰液是什么感染| 教育是什么意思| 黑苦荞茶有什么功效| 直博是什么意思| 呔是什么意思| 痔疮疼痛用什么药| 阴唇黑是什么原因| nb是什么品牌| 六三年属什么生肖| 为什么手会麻| 传销是什么意思| 宝宝发烧手脚冰凉是什么原因| 倒拔垂杨柳是什么意思| 黄加蓝色是什么颜色| 卡哇伊什么意思| 生姜水洗头有什么好处| 小便黄吃什么药| 皮脂腺囊肿吃什么消炎药| 螨虫长什么样子图片| 什么地爬| 秦朝为什么那么快灭亡| 口苦吃什么中药| 芬太尼是什么| 胳膊肘疼痛是什么原因| 绿豆汤放什么糖| 核磁共振能检查什么| 痛风能吃什么水果| 荆州有什么大学| 牙龈紫黑是什么原因| 除湿气吃什么| 心肌供血不足是什么原因造成的| ad吃到什么时候| 早早孕有什么征兆| 四大才子是什么生肖| 公安局跟派出所有什么区别| 屡禁不止的意思是什么| iga什么意思| 明矾是什么东西| 夏天适合种什么菜| 绿茶属于什么茶| 疝气是什么| 小腿肌肉酸痛什么原因| 二甲双胍什么时候吃最好| 中药为什么那么苦| 慢性肠炎有什么症状| 耳石是什么| 肌酐高吃什么中药| 灵芝泡水喝有什么好处| 郡主是什么意思| 煲电话粥什么意思| 手上的月牙代表什么意思| 噬血细胞综合征是什么病| 紫字五行属什么| 农历五月二十四是什么日子| 一点半是什么时辰| 木命和什么命最配| 付之东流是什么意思| 梨子什么时候成熟| 梦见自己在洗澡是什么意思| 对等是什么意思| 三焦指的是什么| 脊髓损伤有什么症状| 笑什么| 破日是什么意思| 时刻是什么意思| 中国文字博大精深什么意思| 社保指什么| 甘油三酯高吃什么药| 养神经的药是什么药最好| 89年是什么命| 副书记是什么级别| 卯是什么生肖| 脚底有痣代表什么意思| 钙盐沉积是什么意思| 支数是什么意思| 非萎缩性胃炎什么意思| 吃饱就犯困是什么原因| 葡萄上的白霜是什么| 火车头是什么意思| 吃什么可以长高| 女性潮热是什么症状| 三角梅用什么肥料最好| 脚底红是什么原因| 知了吃什么食物| 雌激素过高是什么原因造成的| 屋尘螨和粉尘螨是什么| 化疗病人吃什么好| 社畜是什么意思| 1969属什么生肖| 宫颈肥大有什么症状| 六个坚持是什么| 拉肚子吃什么| 高密度脂蛋白胆固醇偏低是什么原因| 什么手机有红外线功能| 日本有什么特产| amy是什么意思| 办健康证挂什么科| 什么姓氏排第一| 轻轻地什么| 面瘫是什么原因引起的| 凌晨12点是什么时辰| 紫薇花什么季节开花| 长期开灯睡觉有什么危害| 四十属什么| 怀才不遇是什么意思| 胎儿停止发育是什么原因造成的| 男人气血不足吃什么药| 月经不来是什么原因导致的| 拉屎肛门疼是什么原因| 双鱼和什么星座最配对| eagle是什么牌子| 腹腔积水是什么原因造成的| 气血不足吃什么中成药| hi是什么酸| 心肾不交失眠吃什么中成药| 绿杨春属于什么茶| 八拜之交是什么生肖| 特种兵是干什么的| 可乐饼为什么叫可乐饼| 湖北人喜欢吃什么菜| dei是什么意思| 梦见豆腐是什么意思| 一点是什么时辰| 心肌炎挂什么科| 鲁班姓什么| ACG是什么牌子| 顺理成章是什么意思| 月经有点黑是什么原因| KTV服务员主要做什么| prbpm是什么意思| 功能性子宫出血是什么原因造成的| 鸡块炖什么好吃| 发烧42度是什么概念| ghz是什么意思| 孕激素低吃什么补得快| cartoon什么意思| 积分落户是什么意思| 倒春寒是什么意思| spao是什么牌子| 火象是什么意思| 高血压可以喝什么饮料| 什么如镜| 学士学位证书有什么用| 拔完牙能吃什么| 肚子胀气什么原因| 冬瓜与什么食物相克| 陆勤合格什么意思| 月经黑褐色是什么原因| 男人太瘦吃什么可以长胖| 830是什么意思| 清心寡欲是什么意思| 成人达己是什么意思| 心脏五行属什么| c类火灾是指什么| 女人湿气重吃什么药效果好| 小孩上户口需要什么材料| 百利甜酒兑什么最好喝| 太阳是一颗什么星| 什么地诉说| 男神是什么意思| 贵气是什么意思| 鱼加完念什么| 芦笋不能和什么一起吃| 什么1| 闲鱼卖出的东西钱什么时候到账| 病毒感染发烧吃什么药| 7.1什么星座| 当志愿者有什么好处| 潜规则是什么意思| 为什么故宫龙椅坐不得| 什么花一年四季都开花| 发烧骨头疼是什么原因| 每天吃三颗红枣有什么好处| 拔牙什么时间最好| 海马体是什么| om什么意思| 酵素什么牌子好| 学习机什么牌子好| 心电图窦性心律不齐是什么意思| 大便是红色的是什么原因| 什么病不能熬夜| 背后长疙瘩是什么原因| 咳痰带血是什么原因| 婴儿黄疸高有什么影响| 家财万贯是什么生肖| 四月是什么月| 为什么会呕吐| 引体向上练什么肌肉| 球拍状胎盘对胎儿有什么影响| 医生为什么叫大夫| 割爱是什么意思| 算什么男人歌词| 怎么查自己五行缺什么| 雌雄是什么意思| 穿丝袜有什么好处| 小孩过敏吃什么药最好| 羽毛球拍什么牌子好| 脂肪肝要注意什么| 晓五行属性是什么| 糖尿病人可以吃什么零食| 心衰为什么会引起水肿| 德行是什么意思| 大什么大| 总胆红素高是怎么回事有什么危害| 堕胎是什么意思| 一倍是什么意思| 3.15是什么星座| 西夏是什么民族| 舌头咬破了用什么药| 湿疹是什么样的症状| 流明是什么意思| 男马配什么属相最好| 胸腔积液挂什么科| 尿为什么是黄色的| 什么杯子喝水最健康| ss是什么意思| 疝是什么意思| 养血清脑颗粒治什么病| 什么是微量元素| 桥字五行属什么| 12月25日是什么日子| 手脚发麻是什么原因引起的| 什么茶叶降血压最好| 什么样的女人最旺夫| 长春新碱是什么药| 我行我素是什么意思| 什么水果不能一起吃| 7一9点是什么时辰| 黄皮果什么时候成熟| 女性尿酸低是什么原因| 高岭土是什么| 控制欲强的人最怕什么| 肾衰竭吃什么好| 欧诗漫是个什么档次| 黑皮肤适合穿什么颜色的衣服| 麦乳精是什么| 韩字五行属什么| 沙葱是什么| 梦见玫瑰花是什么预兆| 视力5.3是什么概念| 吃什么水果可以减肥| 清浅是什么意思| 电解质饮料有什么作用| 立夏节吃什么| 蚊子喜欢叮什么样的人| 4090是什么意思| 衤字旁与什么有关| 同型半胱氨酸是什么| 金牛座是什么性格| 尿隐血弱阳性什么意思| 是什么字| 心衰吃什么药效果最好| 夜来香是什么花| 中耳炎不能吃什么食物| 胃胀呕吐是什么原因| 属龙和什么属相最配| 吃什么补血快效果好| 天麻能治什么病| 肝癌晚期什么症状| 百度Jump to content

Children mark spring equinox with egg traditions

From Wikipedia, the free encyclopedia
Idris
ParadigmFunctional
Designed byEdwin Brady
First appeared2007; 18 years ago (2007)[1]
Stable release
1.3.4[2] / October 22, 2021; 3 years ago (2025-08-06)
Preview release
0.7.0 (Idris 2)[3] / December 22, 2023; 19 months ago (2025-08-06)
Typing disciplineInferred, static, strong
OSCross-platform
LicenseBSD
Filename extensions.idr, .lidr
Websiteidris-lang.org
Influenced by
Agda, Clean,[4] Coq,[5] Epigram, F#, Haskell,[5] ML,[5] Rust[4]
百度 加强和改进流动党员管理。

Idris is a purely-functional programming language with dependent types, optional lazy evaluation, and features such as a totality checker. Idris may be used as a proof assistant, but is designed to be a general-purpose programming language similar to Haskell.

The Idris type system is similar to Agda's, and proofs are similar to Coq's, including tactics (theorem proving functions/procedures) via elaborator reflection.[6] Compared to Agda and Coq, Idris prioritizes management of side effects and support for embedded domain-specific languages. Idris compiles to C (relying on a custom copying garbage collector using Cheney's algorithm) and JavaScript (both browser- and Node.js-based). There are third-party code generators for other platforms, including Java virtual machine (JVM), Common Intermediate Language (CIL), and LLVM.[7]

Idris is named after a singing dragon from the 1970s UK children's television program Ivor the Engine.[8]

Features

[edit]

Idris combines a number of features from relatively mainstream functional programming languages with features borrowed from proof assistants.

Functional programming

[edit]

The syntax of Idris shows many similarities with that of Haskell. A hello world program in Idris might look like this:

module Main

main : IO ()
main = putStrLn "Hello, World!"

The only differences between this program and its Haskell equivalent are the single (instead of double) colon in the type signature of the main function, and the omission of the word "where" in the module declaration.[9]

Inductive and parametric data types

[edit]

Idris supports inductively-defined data types and parametric polymorphism. Such types can be defined both in traditional Haskell 98-like syntax:

data Tree a = Node (Tree a) (Tree a) | Leaf a

or in the more general generalized algebraic data type (GADT)-like syntax:

data Tree : Type -> Type where
    Node : Tree a -> Tree a -> Tree a
    Leaf : a -> Tree a

Dependent types

[edit]

With dependent types, it is possible for values to appear in the types; in effect, any value-level computation can be performed during type checking. The following defines a type of lists whose lengths are known before the program runs, traditionally called vectors:

data Vect : Nat -> Type -> Type where
  Nil  : Vect 0 a
  (::) : (x : a) -> (xs : Vect n a) -> Vect (n + 1) a

This type can be used as follows:

total
append : Vect n a -> Vect m a -> Vect (n + m) a
append Nil       ys = ys
append (x :: xs) ys = x :: append xs ys

The function append appends a vector of m elements of type a to a vector of n elements of type a. Since the precise types of the input vectors depend on a value, it is possible to be certain at compile time that the resulting vector will have exactly (n + m) elements of type a. The word "total" invokes the totality checker which will report an error if the function doesn't cover all possible cases or cannot be (automatically) proven not to enter an infinite loop.

Another common example is pairwise addition of two vectors that are parameterized over their length:

total
pairAdd : Num a => Vect n a -> Vect n a -> Vect n a
pairAdd Nil       Nil       = Nil
pairAdd (x :: xs) (y :: ys) = x + y :: pairAdd xs ys

Num a signifies that the type a belongs to the type class Num. Note that this function still typechecks successfully as total, even though there is no case matching Nil in one vector and a number in the other. Because the type system can prove that the vectors have the same length, we can be sure at compile time that case will not occur and there is no need to include that case in the function’s definition.

Proof assistant features

[edit]

Dependent types are powerful enough to encode most properties of programs, and an Idris program can prove invariants at compile time. This makes Idris into a proof assistant.

There are two standard ways of interacting with proof assistants: by writing a series of tactic invocations (Coq style), or by interactively elaborating a proof term (Epigram–Agda style). Idris supports both modes of interaction, although the set of available tactics is not yet as useful as that of Coq.[vague]

Code generation

[edit]

Because Idris contains a proof assistant, Idris programs can be written to pass proofs around. If treated na?vely, such proofs remain around at runtime. Idris aims to avoid this pitfall by aggressively erasing unused terms.[10][11]

By default, Idris generates native code through C. The other officially supported backend generates JavaScript.

Idris 2

[edit]

Idris 2 is a new self-hosted version of the language which deeply integrates a linear type system, based on quantitative type theory. It currently compiles to Scheme and C.[12]

See also

[edit]

References

[edit]
  1. ^ Brady, Edwin (12 December 2007). "Index of /~eb/darcs/Idris". University of St Andrews School of Computer Science. Archived from the original on 2025-08-06.
  2. ^ "Release 1.3.4". GitHub. Retrieved 2025-08-06.
  3. ^ "Idris 2 version 0.7.0 Released". GitHub. Retrieved 2025-08-06.
  4. ^ a b "Uniqueness Types". Idris 1.3.1 Documentation. Retrieved 2025-08-06.
  5. ^ a b c "Idris, a language with dependent types". Retrieved 2025-08-06.
  6. ^ "Elaborator Reflection – Idris 1.3.2 documentation". Retrieved 27 April 2020.
  7. ^ "Code Generation Targets – Idris Latest documentation". docs.idris-lang.org.
  8. ^ "Frequently Asked Questions". Retrieved 2025-08-06.
  9. ^ "Syntax Guide – Idris 1.3.2 documentation". Retrieved 27 April 2020.
  10. ^ "Erasure By Usage Analysis – Idris latest documentation". idris.readthedocs.org.
  11. ^ "Benchmark results". ziman.functor.sk.
  12. ^ "idris-lang/Idris2". GitHub. Retrieved 2025-08-06.
[edit]
可望不可求是什么意思 什么菜降血压效果最好 更年期是什么时候 siv是什么意思 警告处分有什么影响
玟字五行属什么 飞天是什么意思 山药为什么煮熟了也麻口 鸢是什么意思 胃反流吃什么药
精神心理科主要治疗什么疾病 沄字五行属什么 1924年属什么 单核细胞偏低是什么意思 数位是什么
口水为什么是臭的 蛞蝓是什么动物 甘地是什么种姓 什么验孕棒准确率高 关税是什么
牙齿痛吃什么好hcv7jop6ns2r.cn 妄语是什么意思hcv7jop6ns7r.cn h表示什么inbungee.com 肚子咕咕叫吃什么药hcv8jop6ns7r.cn 砚字五行属什么hcv8jop4ns0r.cn
午时银花露有什么功效hcv8jop1ns6r.cn 酸是什么hcv9jop1ns2r.cn 刘的五行属什么hcv8jop1ns0r.cn 驴血为什么是白色的hcv9jop5ns5r.cn 孕妇可以喝什么饮料hcv8jop4ns2r.cn
衪是什么意思hcv9jop3ns0r.cn 颈动脉有斑块吃什么药wmyky.com 微字五行属什么hcv7jop7ns0r.cn 狗被蜱虫咬了有什么症状hcv9jop6ns1r.cn 什么情况需要打狂犬疫苗hcv8jop9ns8r.cn
三个火是什么字aiwuzhiyu.com 阿拉伯是什么意思hcv8jop8ns6r.cn 梅菜扣肉的梅菜是什么菜hcv8jop6ns6r.cn mfg什么意思zhongyiyatai.com 西周王陵为什么找不到hcv8jop5ns5r.cn
百度