サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ドラクエ3
typelevel.org
The Scala compiler has to do a lot of work to turn your code into jvm bytecode that can be executed. For several reasons, this work is broken into steps which are executed sequentially, the so called phases of the compiler. The Phases If you want to see the phases listed, simply run in your terminal: $ scalac -Xshow-phases Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 phase name id descriptio
Type Classes Type classes are a powerful tool used in functional programming to enable ad-hoc polymorphism, more commonly known as overloading. Where many object-oriented languages leverage subtyping for polymorphic code, functional programming tends towards a combination of parametric polymorphism (think type parameters, like Java generics) and ad-hoc polymorphism. Example: collapsing a list The
This is a guest post by Chris Okasaki. It was initially published as the design document behind scads. It is being republished here with the permission of the original author. A heap (or priority queue) is a collection of elements ordered by some Ordering, optimized for retrieving the first element according to that ordering. Duplicate elements are allowed. Applications vary in whether they need t
Higher-kinded types: the difference between giving up, and moving forward As its opening sentence reminds the reader—a point often missed by many reviewers—the book Functional Programming in Scala is not a book about Scala. This [wise] choice occasionally manifests in peculiar ways. For example, you can go quite far into the book implementing its exercises in languages with simpler type systems. C
Cats Overview Cats is a library which provides abstractions for functional programming in the Scala programming language. Scala supports both object-oriented and functional programming, and this is reflected in the hybrid approach of the standard library. Cats strives to provide functional programming abstractions that are core, binary compatible, modular, approachable and efficient. A broader go
Consider the simple cons-list datatype. import scalaz.Equal, scalaz.std.option._, scalaz.syntax.std.option._, scalaz.std.anyVal._, scalaz.std.function._, scala.reflect.runtime.universe.reify sealed abstract class XList[A] final case class XNil[A]() extends XList[A] final case class XCons[A](head: A, tail: XList[A]) extends XList[A] And a simple function over this structure. Say, a simple summing f
This is the first of a series of articles on “Type Parameters and Type Members”. Type members like Member class Blah { type Member } and parameters like Param class Blah2[Param] have more similarities than differences. The choice of which to use for a given situation is usually a matter of convenience. In brief, a rule of thumb: a type parameter is usually more convenient and harder to screw up, b
Motivating example Assume that you have a case class representing vectors in three-dimensional space: case class Vector3D(x: Int, y: Int, z: Int) Now you want to implement addition on this class. Currently, you have to do that manually: def +(that: Vector3D): Vector3D = Vector3D(this.x + that.x, this.y + that.y, this.z + that.z) If you are writing some code involving three-dimensional vectors, cha
tl;dr Typelevel is forking Scala; we call on all stakeholders in the Scala ecosystem to collaborate on the creation of an independent, non-profit, open source foundation to safeguard the interests of the entire Scala community. Last week I tweeted the following question: How much interest would there be in a community sponsored fork of the #Scala toolchain? RTs and fav's please. — Miles Sabin (@mi
In this post I’d like to introduce you to what I have been calling generic numeric programming. What is Generic Numeric Programming? What do we mean by generic numeric programming? Let’s take a simple example; we want to add 2 numbers together. However, we don’t want to restrict ourselves to a particular type, like Int or Double, instead we just want to work with some generic type A that can be ad
Typelevel is an ecosystem of projects and a community of people united to foster an inclusive, welcoming, and safe environment around functional programming in Scala.
このページを最初にブックマークしてみませんか?
『Typelevel | Home』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く