ocaml

2020年编程语言排行榜!

浪尽此生 提交于 2020-04-18 14:38:47
2020年编程语言排行榜! 小伙伴们,大家好,今天给大家分享的是全球最受欢迎的编程语言,到2020年4月18日。看看你用的语言上榜了吗? 最受欢迎的前20名 其他编程语言 未来可能受欢迎的语言(排名不分先后,使用字母排序) (Visual) FoxPro, ABC, ActionScript, Alice, Arc, ATLAS, Awk, bc, Bourne shell, C shell, CL (OS/400), Clojure, Common Lisp, Crystal, cT, Elixir, Forth, Hack, Icon, Inform, Io, J, Korn shell, Ladder Logic, LiveCode, Maple, Mercury, MQL4, NATURAL, Object Pascal, OCaml, OpenCL, OpenEdge ABL, Oz, PL/I, PostScript, Programming Without Coding Technology, Pure Data, Q, Red, Ring, S, Smalltalk, Solidity, SPARK, Tcl, Vala/Genie, Verilog, VHDL, Whitespace 长期以来受欢迎的编程语言 编程语言名人堂 ps.由权威机构 TIOBE 发布。

2020年编程语言排行榜!

老子叫甜甜 提交于 2020-04-18 14:38:23
小伙伴们,大家好,今天给大家分享的是全球最受欢迎的编程语言,到2020年4月18日。看看你用的语言上榜了吗? 最受欢迎的前20名 其他编程语言 未来可能受欢迎的语言(排名不分先后,使用字母排序) (Visual) FoxPro, ABC, ActionScript, Alice, Arc, ATLAS, Awk, bc, Bourne shell, C shell, CL (OS/400), Clojure, Common Lisp, Crystal, cT, Elixir, Forth, Hack, Icon, Inform, Io, J, Korn shell, Ladder Logic, LiveCode, Maple, Mercury, MQL4, NATURAL, Object Pascal, OCaml, OpenCL, OpenEdge ABL, Oz, PL/I, PostScript, Programming Without Coding Technology, Pure Data, Q, Red, Ring, S, Smalltalk, Solidity, SPARK, Tcl, Vala/Genie, Verilog, VHDL, Whitespace 长期以来受欢迎的编程语言 编程语言名人堂 ps.由权威机构 TIOBE 发布。 今天的推荐不知道大家喜欢吗

Ocaml selecting a type's subtype in another type declaration

雨燕双飞 提交于 2020-04-18 06:54:24
问题 Given two type declarations, I want to use a subtype of one type declaration in another. For instance, say I have colours of Red, Blue, Yellow, how would I specifically reference each subtype when making another type? This example isn't specific to my problem, but it's a simplification of the problem I'm facing. I've tried the below example, straight up referencing Red, etc. I've also tried Red of colour i.e: type colour = | Red | Blue | Yellow type shape = | Rectangle * Red | Square * Yellow

OCaml Typechecking Problem With Functors and Polymorphic Variants

限于喜欢 提交于 2020-04-17 22:34:08
问题 I have a problem using functors in OCaml. I have a module type TASK that is used to have different kinds of tasks: module type TASK = sig type task_information type task_information_as_lists type abstract_u_set_type module AbstractUSet : Set.S with type t = abstract_u_set_type val mk_task_information : task_information_as_lists -> task_information end A module of type TASK will contain algorithms that use nodes. These nodes will have different types. I therefore built TASK_NODE : module type

Algebraic Data Type 及其在 Haskell 和 Scala 中的表现

大兔子大兔子 提交于 2020-04-13 19:53:33
【今日推荐】:为什么一到面试就懵逼!>>> http://songkun.me/2018/07/12/2018-07-12-adt-in-haskell-and-scala/ 函数式编程接触久了以后,我们会发现很多 FP 语言(这里指静态 FP 语言)具有不少类似的语言特性,这非常自然,因为语言特性就那么多,好用、实用的特性更少,这一方面造成了语言之间的同质化,另一方面也减轻了我们语言切换的成本,算是有利也有弊吧。 常见的静态函数式语言有 Haskell、Standard ML、OCaml、Scala 等,它们之间非常类似,共有的特性有: first-class function(匿名函数、高阶函数、闭包、柯里化、部分应用函数…) algebraic data type 模式匹配 类型推断 各个语言也有自己相对独特的特性,比如 Haskell 的 typeclass,Standard ML 和 OCaml 的模块,Scala 的私货就更多了,为了兼容 OO 和 FP 做了很多设计上的妥协,也引入了很多概念。 函数式编程语言也有动态、静态之分,上面列举的都是静态语言,动态语言则以 Lisp 为代表,包括:Scheme、Racket、Clojure、Erlang、Elixir 等,由于动态类型的限制,它们没有 algebraic data type、类型推断等类型系统相关的特性。

Apparently invalid phantom type in OCaml accepted by the compiler

跟風遠走 提交于 2020-03-23 12:01:23
问题 I was trying to answer this question: Ocaml selecting a type's subtype in another type declaration using phantom types. So I was about to propose this code: type colour = Red | Blue | Yellow type shape = Rectangle | Square module ColouredShape : sig (* Type parameterized by 'a, just for the type system. 'a does not appear in the right hand side *) type 'a t = shape * colour (* Dummy types, used as labels in the phantom type *) type red type yellow val make_red : shape -> red t val make_yellow

Type errors when using same name

孤人 提交于 2020-03-03 11:41:05
问题 I have 3 files: 1) cpf0.ml type string = char list type url = string type var = string type name = string type symbol = | Symbol_name of name 2) problem.ml: type symbol = | Ident of string 3) test.ml open Problem;; open Cpf0;; let symbol b = function | Symbol_name n -> Ident n When I combine test.ml : ocamlc -c test.ml . I received an error: This expression has type Cpf0.name = char list but an expression was expected of type string Could you please help me to correct it? Thank you very much

How can I install OCaml with OPam on windows?

穿精又带淫゛_ 提交于 2020-02-11 07:16:10
问题 How can I install OCaml with OPam on windows? 回答1: I have been able to setup OCaml 4.03.0 in Windows 10, using the Opam package manager, by following the tutorial from this website: http://fdopen.github.io/opam-repository-mingw/. Here are the detailed steps that I did: Install OCaml, Opam and Cygwin: Download the installation package from this link: http://fdopen.github.io/opam-repository-mingw/installation/. There are both the 32 bit and 64 bit version, but I suggest to install the OCaml

How can I install OCaml with OPam on windows?

白昼怎懂夜的黑 提交于 2020-02-11 07:11:27
问题 How can I install OCaml with OPam on windows? 回答1: I have been able to setup OCaml 4.03.0 in Windows 10, using the Opam package manager, by following the tutorial from this website: http://fdopen.github.io/opam-repository-mingw/. Here are the detailed steps that I did: Install OCaml, Opam and Cygwin: Download the installation package from this link: http://fdopen.github.io/opam-repository-mingw/installation/. There are both the 32 bit and 64 bit version, but I suggest to install the OCaml

Ocaml: path in a graph is repeated even if this has already been found

眉间皱痕 提交于 2020-02-06 07:49:30
问题 I wrote some function to search the list of possible paths from a starting node to an ending node. The function list_of_paths correctly returns all the possible paths from a starting point to an ending point but the same path inside the list is repeated even if this has already been found. For example calling the function: list_of_paths 2 7 (List.rev (bfs g1 2)) (node_succ g1) 2 returns: [[2; 3; 6; 7]; [2; 3; 6; 7]; [2; 3; 4; 6; 7]; [2; 3; 6; 7]; [2; 1; 5; 6; 7]; [2; 3; 6; 7]; [2; 1; 5; 6; 7]