Skip to content

Instantly share code, notes, and snippets.

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@gakuzzzz
gakuzzzz / gist:8d497609012863b3ea50
Last active January 12, 2021 12:50
Scalaz勉強会 主要な型クラスの紹介
@gakuzzzz
gakuzzzz / 1_.md
Last active August 2, 2023 01:59
Scala の省略ルール早覚え

Scala の省略ルール早覚え

このルールさえ押さえておけば、読んでいるコードが省略記法を使っていてもほぼ読めるようになります。

メソッド定義

def concatAsString(a: Int, b: Int): String = {
  val a_ = a.toString();
  val b_ = b.toString();
@tlync
tlync / transparent-context.scala
Last active February 8, 2018 06:36
Scala Advent Calendar 2013 12/11 の記事で利用した Transparent IO Context パターンのコード
// Transparent IO Context pattern using implicit parameter
// ---
// domain
// ---
// base (サンプルなのでほぼただの Marker Trait)
trait Entity
// 永続化に利用するセッションを保持するただのコンテナ
@leon
leon / Grunt.scala
Last active September 3, 2016 02:23
Playframework 2.2 Grunt Runner
import sbt._
import Keys._
import java.net._
import java.io.File
import play.PlayRunHook
/*
Grunt runner should be in project directory to be picked up by sbt
*/
object Grunt {
@kishida
kishida / App.java
Created August 17, 2012 16:00
かわいいデータベース
package kis.basicdb;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname