Scala Cookbook 저자가 씀, 개발 뿐만 아니라 FP의 역사와 같은 내용도 포함되어 있음
ENSIME 메인 메인테이너가 씀 - scalaz를 활용하여 FP로 프로그래밍을 할수 있는방법에 대해서 알려줌
일명 빨간 책이라 불리며, scala + FP의 바이블 같은 존재, 하지만 어려움
#!/usr/bin/env bash | |
ARMERIA_DIR=??? # Path to Armeria project | |
RELEASE_NOTES_DIR=site/src/pages/release-notes | |
VERSIONS=$@ | |
all="" | |
for version in $VERSIONS; do | |
current=`grep " '" $ARMERIA_DIR/$RELEASE_NOTES_DIR/$version.mdx | sed "s/[',]//g"` | |
all="$all$current" | |
done |
/* | |
* Copyright 2023 LINE Corporation | |
* | |
* LINE Corporation licenses this file to you under the Apache License, | |
* version 2.0 (the "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at: | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
package com.example.armeria; | |
import static org.assertj.core.api.Assertions.assertThat; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Set; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.extension.RegisterExtension; |
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
log() { | |
echo -en '\033[1;32m' | |
echo -n "$@" | |
echo -e '\033[0m' | |
} | |
choice() { |
Scala Cookbook 저자가 씀, 개발 뿐만 아니라 FP의 역사와 같은 내용도 포함되어 있음
ENSIME 메인 메인테이너가 씀 - scalaz를 활용하여 FP로 프로그래밍을 할수 있는방법에 대해서 알려줌
일명 빨간 책이라 불리며, scala + FP의 바이블 같은 존재, 하지만 어려움
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
BREW='/opt/homebrew/bin/brew' | |
if [[ ! -x "$BREW" ]]; then | |
echo 'Install Homebrew first:' | |
echo | |
echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' | |
echo | |
exit 1 |
#!/bin/bash | |
# zsh | |
echo "Installing zsh..." | |
chsh -s `which zsh` | |
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh | |
# homebrew, pip | |
echo "Installing homebrew, pip..." | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
// https://twitter.github.io/scala_school/type-basics.html | |
// 트위터 스칼라 스쿨에 나오는 자료구조를 활용해보겠다. | |
class Animal { val sound = "rustle" } | |
class Bird extends Animal { override val sound = "call" } | |
class Chicken extends Bird { override val sound = "cluck" } | |
class Duck extends Bird { override val sound = "duck" } | |
def foo(tweet: Bird => String) = { | |
tweet(new Bird) |
{ | |
// comments | |
unquoted: 'and you can quote me on that', | |
singleQuotes: 'I can use "double quotes" here', | |
lineBreaks: "Look, Mom! \ | |
No \\n's!", | |
hexadecimal: 0xdecaf, | |
leadingDecimalPoint: .8675309, andTrailing: 8675309., | |
positiveSign: +1, | |
trailingComma: 'in objects', andIn: ['arrays',], |
Unit
타입에 반환하는 함수의 반환값을 확인하지 않으면 컴파일러 워닝이 발생함
-Xfatal-warnings
옵션이 활성화 되면 컴파일도 실패됨Function<? super HttpService, ? HttpService>
형태의 일 경우에 Scala Function에서 바로 형변환이 되지 않기 때문에 delegate => new MyHttpService(delegate)
를 해줘야 함