Revision 16 not available (showing current revision instead)

proj-plbook-plChFuncLangs

Table of Contents for Programming Languages: a survey

Haskell

Because it is so well-liked, Haskell gets its own chapter.

See chapter on chapter on Haskell

Scala

Scala is a multiparadigm language, both OOP and functional.

Tours and tutorials:

Cons:

Best practices:

Tutorials and books:

Comparisons:

Features:

The AbsCell? class has an abstract type member T and an abstract value member init. Instances of that class can be created by implementing these abstract members with concrete definitions.

val cell = new AbsCell? { type T = Int; val init = 1 } cell.set(cell.get * 2)

The type of cell is AbsCell? { type T = Int }.

Path-dependent Types: You can also use AbsCell? without knowing the specific cell type:

def reset(c: AbsCell?): Unit = c.set(c.init);

Why does this work?

In general, such a type has the form x0...xn.t, where

Some notes on Scala 3 features:

example of scala 3 'givens' which are (part of) the successor to scala implicits:

https://alvinalexander.com/source-code/scala-3-dotty-complete-givens-using-example/

so afaict these are just similar to Haskell typeclass instances. I guess what scala is really contributing is that i think these are lexically scoped, rather than globals like (i think) in Haskell.

Extensions:

Retrospectives:

Implementations:

Opinions:

*> . Someone said out loud “what the hell is that?”. There was some other implicit magic going on that wasn’t immediately apparent. A CMD+B to traverse into the method yielded nothing in our IDE as it couldn’t find the symbol (IDE’s have improved here since). A quick googling of “<*>” yielded nothing as well....That blip turned a fix that should have taken minutes into a fix that took hours....(((another example of hard to read code))) https://gist.githubusercontent.com/jiminoc/ea827cfaf0bb8b07df6b/raw/e6402f48c2a97d537c7d80ea1284f9d3a380730d/sample.scala....." -- [13]