Are you a Scala first-timer who find yourself fighting with the build system for even the simplest of tasks? Then this guide is for you. If you are a Scala veteran that just never bothers to remember the syntax, then this is for you as well.
Algebra Cheat Sheet Basic Properties & Facts Arithmetic Operations ( ),0 bab abacabca cc a b aaac cbcbb c acadbcacadbc bdbdbdbd abbaabab cddcccc a abacb ad bca ac bc d. Mar 07, 2020 Exhaustive, simple, beautiful and concise. A truly pythonic cheat sheet about Python programming language.
Contribute to dhall-lang/dhall-lang development by creating an account on GitHub. This page has moved to docs.dhall-lang.org - Cheatsheet. This copy of the page will no longer be kept up-to-date. ' Natural / isZero 2 = False Natural / even 2 = True Natural / odd 2 = False Natural / subtract 1 3 = 2.
Also, remember that this guide assumes SBT 0.13.x.
Hello World
Let's go back to basic! This is how to prepare a project's base directory:
Contents of
build.sbt
:Main.scala
might look like:If you are using Git, add the following directories to
.gitignore
. They are auto generated and you don't want them:Now, try to run it from the base directory,
hello-world
. Remember, you must run it from the base directory.Horray!
Dependencies
Specifying multiple dependencies one by one in
build.sbt
:Alternatively, you can also specify them as a
Seq
Commands
SBT commands that are most likely to be used on a daily basis
This page has moved to
docs.dhall-lang.org
- CheatsheetThis copy of the page will no longer be kept up-to-date
Command line
Cheatsheet 1.3.4
- Feed Dhall expressions to
dhall
's standard input to type-check and evaluate them: - Add the
--explain
flag for detailed explanations of type errors. - Add the
--pretty
flag to format output.
Primitive types
Bool
:Natural
:A non-negative number (unsigned):Integer
:An integer, prefixed with a+
or-
sign:Double
:A double-precision floating point number with optional scientific notation:Text
:
Complex types
List
:A collection of 0 or more elements of the same typeType annotation is mandatory for empty lists:Optional
:- RecordsA mapping from field names to values that can be different types
- Unions
Cheat Sheet 1.3.5
Programming
let
expressions:You can also uselet
expressions to name functions and imported values:- Anonymous functionsThe type of a function's input argument is required and not inferred:
- PolymorphismType abstraction and type application are explicit:
- Assertions
- ImportsImported paths or URLs are substituted for their contents:Adding
as Text
imports the contents of the import as aText
value instead of aDhall expression:You can specify a fallback expression if the import fails using?
This fallback expression can contain another import:... or even be a pure value: - PreludeYou can find latest Prelude of importable functions at https://prelude.dhall-lang.org/