mercury

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 发布。 今天的推荐不知道大家喜欢吗

Creating a deterministic finite automata (DFA) - Mercury

僤鯓⒐⒋嵵緔 提交于 2020-01-11 06:50:53
问题 I would like to have a deterministic finite automata (DFA) simulated in Mercury. But I’m s(t)uck at several places. Formally, a DFA is described with the following characteristics: a setOfStates S, an inputAlphabet E <-- summation symbol, a transitionFunction : S × E --> S, a startState s € S, a setOfAcceptableFinalStates F =C S. A DFA will always starts in the start state. Then the DFA will read all the characters on the input, one by one. Based on the current input character and the current

Building Multi-Module Mercury Programs

末鹿安然 提交于 2019-12-24 02:07:42
问题 Q. What's a simple template for building a two-module mercury program? Module_1 defines and exports a simple function or predicate. Module_2 imports the function/predicate to compute a useful result and outputs the result. 回答1: I would use the following approach, first define the module with the function(s) or predicate(s) or predicates you want to export (interface section): % File: gcd.m :- module gcd. :- interface. :- import_module integer. :- func gcd(integer, integer) = integer. :-

Most useful and instructive functional-logic language to learn

 ̄綄美尐妖づ 提交于 2019-12-20 19:43:14
问题 I was pretty amazed by the power of Prolog. It took some time to get the head around, but to me it seemed to be the coolest declarative language out there. That's why recently, after two years of some functional programming with Scala, I decided to take a look at logical programming again, to "train my brain" or better for actual usage. Combining functional and logical programming seems attractive for me to learn/solidify concepts of both declarative paradigms. I find also find strong type

Why does this variable have an instantiatedness of free?

孤人 提交于 2019-12-11 11:18:05
问题 I've written a Mercury function to calculate the length of a list skeleton, but it doesn't compile and I don't understand why. I'd like to know what's going on here. (In the code below, the inst , func , and mode statements are from the Mercury Reference Manual, sections 4.1 and 4.2. I'm writing a function body from the manual's declarations.) :- inst my_listskel == bound( [] ; [free | my_listskel] ). :- func my_length(list(T)) = int. :- mode my_length(in(my_listskel)) = out. my_length([]) =

Most useful and instructive functional-logic language to learn

自闭症网瘾萝莉.ら 提交于 2019-12-03 07:08:02
I was pretty amazed by the power of Prolog. It took some time to get the head around, but to me it seemed to be the coolest declarative language out there. That's why recently, after two years of some functional programming with Scala, I decided to take a look at logical programming again, to "train my brain" or better for actual usage. Combining functional and logical programming seems attractive for me to learn/solidify concepts of both declarative paradigms. I find also find strong type systems very useful and fascinating. Scala really shined with interop. Let's not reinvent wheels. It

Creating a deterministic finite automata (DFA) - Mercury

不羁的心 提交于 2019-12-01 10:52:24
I would like to have a deterministic finite automata (DFA) simulated in Mercury. But I’m s(t)uck at several places. Formally, a DFA is described with the following characteristics: a setOfStates S, an inputAlphabet E <-- summation symbol, a transitionFunction : S × E --> S, a startState s € S, a setOfAcceptableFinalStates F =C S. A DFA will always starts in the start state. Then the DFA will read all the characters on the input, one by one. Based on the current input character and the current state, there will be made to a new state. These transitions are defined in the transitions function.

What other ways can state be handled in a pure functional language besides with Monads?

China☆狼群 提交于 2019-11-28 15:18:59
问题 So I started to wrap my head around Monads (used in Haskell). I'm curious what other ways IO or state can be handled in a pure functional language (both in theory or reality). For example, there is a logical language called "mercury" that uses "effect-typing". In a program such as haskell, how would effect-typing work? How does other systems work? 回答1: There are several different questions involved here. First, IO and State are very different things. State is easy to do yourself: Just pass an