scala 学习scala的小而好的scala项目——尤其是函数式编程和类型系统

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9772631/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 04:00:30  来源:igfitidea点击:

Small and good scala projects to learn scala -- especially functional programming and type system

scalafunctional-programmingtype-systems

提问by Freewind

I've studied scala for several months, but still at the beginner level. Now I found I have huge trouble with functional programming and scala's type system.

我已经学习了几个月的 Scala,但仍处于初学者水平。现在我发现我在函数式编程和 Scala 的类型系统方面遇到了很大的麻烦。

I tried finding some documents and blogs, but I can't understand most of them(especially type-system ones). So I'm looking for some small and good scala projects that I can read the sources to learn.

我试图找到一些文档和博客,但我无法理解其中的大部分(尤其是类型系统的)。所以我正在寻找一些小的和好的 Scala 项目,我可以阅读源代码来学习。

Could you please recommend me some?

你能给我推荐一些吗?

回答by Heather Miller

There's a popular set of "Scala Problems" out there, called the 99 Scala Problems

有一组流行的“Scala 问题”,称为99 Scala 问题

Problems come in all difficulties, and many flavors, basic functional programming included.

问题出现在各种困难中,并且有多种形式,包括基本的函数式编程。

回答by AndreasScheinert

If you follow the community there are the common suspects(those writing the scalaz book):

如果你关注社区,就会有常见的嫌疑人(那些写 scalaz 书的人):

If you through this I have some more :) If you want an suggested order I word start with debasishs blog , then the simple exercises from tonys blog then read through runars blog(even the java ones!) then Erics after that Pauls and have a look at lucs ideas.

如果你通过这个,我还有更多 :) 如果你想要一个建议的顺序,我的话从 debasishs 博客开始,然后是 tonys 博客中的简单练习,然后通读 runars 博客(甚至是 Java 博客!)看看 lucs 的想法。

回答by Christian

回答by consuela

You can try the "Functional Programming Principles in Scala" video courseby the designer of Scala, Martin Odersky. You only need to register at Coursera (click on the "Join for Free" button on the right sidebar) and then you will have access to the class which consists of lecture videos, between 6 and 15 minutes in length, that are accompanied by assignments, subtitlesand slidesper video.

您可以尝试Scala设计者 Martin Odersky的“ Scala 中的函数式编程原则视频课程。您只需要在 Coursera 上注册(点击右侧边栏上的“免费加入”按钮),然后您就可以访问包含讲座视频的课程,长度在 6 到 15 分钟之间,并附有作业、每个视频的字幕幻灯片

The course also provides learning resources, discussion forums, instructions to setup tools, sbt tutorial, Eclipse tutorial, IntelliJ IDEA tutorial, Scala tutorial, Scala style guide and a Scala cheatsheet.

该课程还提供学习资源、论坛、设置工具说明、sbt 教程、Eclipse 教程、IntelliJ IDEA 教程、Scala 教程、Scala 风格指南和 Scala 备忘单。

I also came across a series of very nicely written blog posts on Scala by Joel Abrahamsson:

我还看到了 Joel Abrahamsson 写的一系列关于 Scala 的非常好的博客文章:

  1. Introduction
  2. Installation and tools
  3. Executing Scala code
  4. Classes and constructors
  5. Methods
  6. If statements and loops
  7. Traits
  8. Scala's type hierarchy and object equality
  9. Uniform Access
  1. 介绍
  2. 安装和工具
  3. 执行 Scala 代码
  4. 类和构造函数
  5. 方法
  6. If 语句和循环
  7. 性状
  8. Scala 的类型层次结构和对象相等性
  9. 统一访问

I hope the resources that I provided will prove to be helpful.

我希望我提供的资源将被证明是有帮助的。

回答by zapstar

HackerRankhas tons of problems that you can code up in multiple functional programming languages including Scala. The best part is that they have pre-written tests like an online judge.

HackerRank有很多问题,您可以使用多种函数式编程语言(包括 Scala)进行编码。最好的部分是他们像在线法官一样进行了预先编写的测试。

回答by Andriy Plokhotnyuk

If you are looking for some step-by-step tutorial than you should test "Functional Programming in Scala"

如果您正在寻找一些分步教程,那么您应该测试“Scala 中的函数式编程”

Try to complete exercisesfrom sample chapters 1& 10to see if it match your expectations.

尝试完成演习从样章110,看它是否符合您的期望。

回答by saurin shah

If you are already familiar with any language like JAVA, PYTHONor any other,you can refer - https://www.tutorialspoint.com/scala/index.htmto get used to the basic syntax and some peculiar scala concepts like traits. If you are inclined towards data oriented projects, You can always start with basic projects like Word Count in a file. This gives you a good start towards playing around with data. You can then work around with multiple files, multiple tables. Use SPARK, HADOOPwith scala to get a better hands on experience in handling multiple data.

如果您已经熟悉任何语言,如JAVA、PYTHON或任何其他语言,您可以参考 - https://www.tutorialspoint.com/scala/index.htm以习惯基本语法和一些特殊的 scala 概念,如traits。如果您倾向于面向数据的项目,您总是可以从基本项目开始,例如文件中的字数统计。这为您处理数据提供了一个良好的开端。然后,您可以处理多个文件、多个表。将SPARK、HADOOP与 Scala 结合使用以获得更好的处理多个数据的实践经验。