如果你也在 怎样代写Haskell这个学科遇到相关的难题,请随时右上角联系我们的24/7代写客服。Haskell是一种通用的、静态类型的、纯函数式的编程语言,具有类型推理和懒惰评估的功能。Haskell的主要实现是Glasgow Haskell编译器(GHC)。它是以逻辑学家Haskell Curry的名字命名的。
Haskell的语义在历史上是以Miranda编程语言为基础的,Miranda编程语言是最初Haskell工作组的工作重点。该语言的最后一个正式规范是在2010年7月制定的,而GHC的发展通过语言扩展扩展了Haskell。下一个正式规范计划在2020年制定。2021年10月29日,GHC2021在GHC 9.2.1版本中发布。Haskell被用于学术界和工业界。截至2021年5月,Haskell是谷歌搜索教程的第28位最受欢迎的编程语言,在GitHub源代码库的活跃用户中占不到1%。
my-assignmentexpert™ Haskell作业代写,免费提交作业要求, 满意后付款,成绩80\%以下全额退款,安全省心无顾虑。专业硕 博写手团队,所有订单可靠准时,保证 100% 原创。my-assignmentexpert™, 最高质量的Haskell作业代写,服务覆盖北美、欧洲、澳洲等 国家。 在代写价格方面,考虑到同学们的经济条件,在保障代写质量的前提下,我们为客户提供最合理的价格。 由于统计Statistics作业种类很多,同时其中的大部分作业在字数上都没有具体要求,因此Haskell作业代写的价格不固定。通常在经济学专家查看完作业要求之后会给出报价。作业难度和截止日期对价格也有很大的影响。
想知道您作业确定的价格吗? 免费下单以相关学科的专家能了解具体的要求之后在1-3个小时就提出价格。专家的 报价比上列的价格能便宜好几倍。
my-assignmentexpert™ 为您的留学生涯保驾护航 在cs作业代写方面已经树立了自己的口碑, 保证靠谱, 高质且原创的Haskell代写服务。我们的专家在cs代写方面经验极为丰富,各种Haskell相关的作业也就用不着 说。
我们提供的Haskell及其相关学科的代写,服务范围广, 其中包括但不限于:
cs代写|Haskell作业代写Haskell代考|Basic concepts
A type is a collection of related values. For example, the type Bool contains the two logical values False and True, while the type Bool $\rightarrow$ Bool contains all functions that map arguments from Bool to results from Bool, such as the logical negation function $\neg$. We use the notation $v:: T$ to mean that $v$ is a value in the type $T$, and say that $v$ “has type” $T$. For example:
$$
\begin{array}{lll}
\text { False } & :: & \text { Bool } \
\text { True } & :: & \text { Bool } \
\neg & :: & \text { Bool } \rightarrow \text { Bool }
\end{array}
$$
More generally, the symbol :: can also be used with expressions that have not yet been evaluated, in which case $e:: T$ means that evaluation of the expression $e$ will produce a value of type $T$. For example:
$$
\begin{array}{lll}
\neg \text { False } & :: & \text { Bool } \
\neg \text { True } & :: & \text { Bool } \
\neg(\neg \text { False }) & :: & \text { Bool }
\end{array}
$$
In Haskell, every expression must have a type, which is calculated prior to evaluating the expression by a process called type inference. The key to this process is a typing rule for function application, which states that if $f$ is a function that maps arguments of type $A$ to results of type $B$, and $e$ is an expression of type $A$, then the application $f e$ has type $B$ :
$$
\frac{f:: A \rightarrow B \quad e:: A}{f e:: B}
$$
cs代写|Haskell作业代写Haskell代考|Basic types
Haskell provides a number of basic types that are built-in to the language, of which the most commonly used are described below.
Bool – logical values
This type contains the two logical values False and True.
Char – single characters
This type contains all single characters that are available from a normal keyboard, such as ‘ $a$ ‘, ‘A’, ‘ 3 ‘ and ‘_’, as well as a number of control characters that have a special effect, such as ‘ $\backslash \mathrm{n}$ ‘ (move to a new line) and ‘\t’ (move to the next tab stop). As is standard in most programming languages, single characters must be enclosed in single forward quotes, ‘.
cs代写|Haskell作业代写Haskell代考|Function application
A list is a sequence of elements of the same type, with the elements being enclosed in square parentheses and separated by commas. We write $[T]$ for the type of all lists whose elements have type $T$. For example:
$$
\begin{array}{lll}
{[\text { False, True, False }]} & :: & {[\text { Bool }]} \
{[\text { ‘a’, ‘b’, ‘c’, ‘d’] }} & :: & {[\text { Char }]} \
{[\text { “One”, “Two”, “Three”] }} & :: & {[\text { String }]}
\end{array}
$$
The number of elements in a list is called its length. The list [] of length zero is called the empty list, while lists of length one, such as such as [False] and [‘a’], are called singleton lists. Note that [[]] and [] are different lists, the former being a singleton list comprising the empty list as its only element, and the latter being simply the empty list.
There are three further points to note about list types. First of all, the type of a list conveys no information about its length. For example, the lists $[$ False, True $]$ and $[$ False, True, False $]$ both have type $[$ Bool $]$, even though they have different lengths. Secondly, there are no restrictions on the type of the elements of a list. At present we are limited in the range of examples that we can give because the only non-basic type that we have introduced at this point is list types, but we can have lists of lists, such as:
$$
\left[\left[‘ \mathrm{a}^{\prime}, \mathrm{b}^{\prime}\right],\left[‘ \mathrm{c}^{\prime}, \mathrm{d}^{\prime}, \mathrm{e}^{\prime}\right]\right] \quad:: \quad[[\text { Char }]]
$$
Finally, there is no restriction that a list must have a finite length. In particular, due to the use of lazy evaluation in Haskell, lists with an infinite length are both natural and practical, as we shall see in chapter $12 .$
HASKELL作业代写
CS代写|HASKELL作业代写HASKELL代考|BASIC CONCEPTS
类型是相关值的集合。例如,类型 Bool 包含两个逻辑值 False 和 True,而类型 Bool→Bool 包含将参数从 Bool 映射到 Bool 结果的所有函数,例如逻辑否定函数¬. 我们使用符号在::吨意思是在是类型中的一个值吨,然后说在“有类型”吨. 例如:
错误的 :: 布尔 真的 :: 布尔 ¬:: 布尔 → 布尔
更一般地,符号 :: 也可以用于尚未计算的表达式,在这种情况下和::吨意味着表达式的评估和将产生一个类型的值吨. 例如:
$$
\begin{array}{lll}
\neg \text { False } & :: & \text { Bool } \
\neg \text { True } & :: & \text { Bool } \
\neg(\neg \text { False }) & :: & \text { Bool }
\end{array}
$$
在 Haskell 中,每个表达式都必须有一个类型,该类型在计算表达式之前通过称为类型推断的过程进行计算。这个过程的关键是函数应用的打字规则,它规定如果F是一个映射类型参数的函数一种到类型的结果乙, 和和是类型的表达式一种, 然后应用F和有类型乙 :
F::一种→乙和::一种F和::乙
CS代写|HASKELL作业代写HASKELL代考|BASIC TYPES
Haskell 提供了许多内置于语言中的基本类型,其中最常用的描述如下。
Bool – 逻辑值
此类型包含两个逻辑值 False 和 True。
Char – 单个字符
此类型包含普通键盘可用的所有单个字符,例如 ‘一种’、’A’、’3’和’_’,以及一些有特殊效果的控制字符,如’∖n ‘ 米这在和吨这一种n和在l一世n和和T’米这在和吨这吨H和n和X吨吨一种bs吨这p. 作为大多数编程语言的标准,单个字符必须用单引号括起来,’。
CS代写|HASKELL作业代写HASKELL代考|FUNCTION APPLICATION
列表是相同类型的元素的序列,元素用方括号括起来并用逗号分隔。我们写[吨]对于其元素具有类型的所有列表的类型吨. 例如:
$$
\begin{array}{lll}
{[\text { False, True, False }]} & :: & {[\text { Bool }]} \
{[\text { ‘a’, ‘b’, ‘c’, ‘d’] }} & :: & {[\text { Char }]} \
{[\text { “One”, “Two”, “Three”] }} & :: & {[\text { String }]}
\end{array}
$$
列表中元素的数量称为其长度。名单长度为 0 的列表称为空列表,而长度为 1 的列表,例如F一种ls和和‘一种′, 称为单例列表。注意[] 和是不同的列表,前者是包含空列表作为其唯一元素的单例列表,而后者只是空列表。
关于列表类型,还有三点需要注意。首先,列表的类型不传达有关其长度的信息。例如,列表[假,真]和[假,真,假]都有类型[布尔],即使它们的长度不同。其次,列表元素的类型没有限制。目前我们可以给出的例子范围有限,因为我们在这一点上介绍的唯一非基本类型是列表类型,但我们可以有列表的列表,例如:
$$
\left[\left[‘ \mathrm{a}^{\prime}, \mathrm{b}^{\prime}\right],\left[‘ \mathrm{c}^{\prime}, \mathrm{d}^{\prime}, \mathrm{e}^{\prime}\right]\right] \quad:: \quad[[\text { Char }]]
$$
最后,没有限制列表必须具有有限长度。特别是,由于在 Haskell 中使用惰性求值,无限长度的列表既自然又实用,我们将在本章中看到12.
cs代写|Haskell作业代写Haskell代考 请认准UprivateTA™. UprivateTA™为您的留学生涯保驾护航。