学習コストが低く、キャッチアップがしやすいもともとKotlin書いてた人が誰もいないのに、キャッチアップまでが相当早かったです。 特に動的型付言語のRubyを書いていた人でも大きな戸惑いなく使用できたのは意外でした。 これはJava、Scalaに比べると大きな違いだと考えています。高品質なコードが書けている型の制約がきき、null-safeなど安全に書くための言語仕様がうまく働きます。集合に対する便利な操作を行うメソッドがあったり、記述量少なくシンプルに実装できるための機能がいろいろあります。
index.md MonadTransformer とは何か 注意書き この記事は Monad がわかる人に向けた MonadTransformer の解説記事です。 すごいH本や FP in Scala などでモナドまではイメージが掴めたけれど、モナドトランスフォーマーが何かわからない、という層をターゲットに想定しています。 基本的に Functor, Applicative, Monad および型クラスについては把握しているものとしますので、この辺があやふやな方は別の資料などをご参照下さい。 サンプルコードとして Scala を利用します。ただし、説明の都合上、高階型引数について kind-projector の ? を用いた表記を使います。 例えば List[A] 型のモナドインスタンスは通常 Monad[List] 型として表しますが、この資料では Monad[List[?]] と
2. 自己紹介 - 名前: 高瀬 和之 (たかせ かずゆき) - 所属: Chatwork 株式会社 @大阪 - たぶん得意なこと: - フロントエンド開発 (React / Redux / TypeScript) - ティーチング (アルゴリズム / 機械学習 / 数学 / 組み込みシステム) - ひとこと: - Scala のイベントは 2 回目です 💪 2 3. 1. 本日の茶番パート 2. 圏論の公理 3. 函手,自然変換,函手圏 4. 米田の補題 アジェンダ 3 - この発表を聞いて得られるもの 👨🏫 - 圏論の中でも登竜門的なトピックである "米田の補題" を知ることができる - "米田の補題" のプログラミング的位置づけを知ることができる - ※ 後ろのセッションもないので、40 分をややオーバーするやも 😗
最近、圏論とプログラミングという素晴らしい資料を拝読しました。圏論とプログラミング愛に溢れる資料で読んでいて目頭が熱くなりました。そうだよな・・・プログラマにも圏論いるよな・・・ ただ、自分にとって残念だったのは、資料で説明用に選択されたプログラミング言語が「Haskell」だったことです。もちろんHaskellは素晴らしい言語です。ただ、自分にとってHaskellは外国語なのでちょっと理解が難しいのです。なのでこの資料が「Scala」で書かれていたらと夢想せずにはいられなかったのです。 Scalaと言えば昨年末にScala3のリサーチコンパイラのDottyがFeature Completeを宣言しました1。この宣言で新機能の追加は終了して、あとは2020年末のリリースに向けてひたすら品質を上げていく段階に突入しました。つまり、ようやく次世代のScalaが全貌を現したということです。 ここ
経緯 Scala(PlayFramework) x DDDでアプリケーションを実装する際、UseCase層(Application層)を実装する際に辛さが出てくる。 何が辛いかと言うと、型のネストである。 というのも、 UseCase層ではエンティティ操作の過程で仕様周りのバリデーションをやることになりEitherが出てくる 例:ハンターがモンスターから素材を剥ぎ取るためには、モンスターが既に死んでいる必要がある (PlayFrameworkだと特に)Repository層での呼び出してFutureが出てくる そのため、UseCase層での各処理の型合わせが必然的に複雑になる傾向にある。 サンプル 例として、なんちゃってモンハンを想定して「ハンターがモンスターにダメージを与える」というユースケースを実装してみる。 *いろんな突っ込みがあると思うのですが、マサカリはヤメてください。 forの
はじめに 近頃の for 文は、コレクションの要素を直接参照できたり、 yield で評価結果を返せたり、多重ループを一気に回せたり、便利なものが多いですね。たとえば Scala であれば、こんなふうに書けます。 val list = for { a <- List(100) b <- List(10, 20) c <- List(1, 2, 3) } yield a + b + c print(list) // List(111, 112, 113, 121, 122, 123) この for 文のみを頼りに、ときおり関数型プログラマが唱える「モナド」に入門してみよー、というのが本記事の趣旨です。 なるべく簡単なコードを挙げながら、できるだけ「圏論」の各種定義やその気持ちまで掘っていくので、前提知識なしで読みすすめられると思います。 Scala の for 文 まずは Scala 使いで
はじめに 弊社で開発するモバイルバックエンドのサーバサイドAPIアプリケーションコード (Play framework + Scala) はビジネスロジックを担う主要なパッケージである services, domains が外部のインフラやAPIインターフェイスに直接依存しないようなパッケージ構成をとっています。(Clean Architecture) services, domains の構成についてはDDDの経験が浅く、まだまだ改善の余地があると考えており、今後どうしていくか考えていくにあたって参考になるであろうページをまとめてみました。 尚、DDDまわりにおける筆者の現在の知識はドメイン駆動設計の第二部までを読み終わり、第三部を読み始めた程度です。 DDDと関連のあるCQRS+ES(Command and Query Responsibility Segregation + Even
よく遭遇する、Scala標準ライブラリだけだと大変なケースでも、 Catsを使うとうまく関心事を分離して、クリーンかつ拡張に対して頑強になることがあります。 このスライドでは、そういった場合のCatsの使い所について、初学者向けに解説をしています。 2019年7月26日のセプテーニ・オリジナルでの社内勉強会資料です。
アプリケーションエンジニアの id:tanishiking24 です。2019年6月27日から29日にかけて開催されたScalaMatsuri2019にて、「いかにして我々は10年もののPerlプロダクトをScalaでリプレースしたか」というタイトルで登壇しました。 speakerdeck.com (イベントのレギュレーション上、発表資料は英語+日本語字幕で構成されていますが、トーク自体は日本語でした。) この発表では我々が運用しているWebサービスの一つであるはてなブックマークのScalaを用いたフルリニューアルプロジェクトについてお話しました。同じ時間帯に他にも様々な魅力的なトラックがあったにもかかわらず多くの人が発表を聞きに来てくださり、Twitterのハッシュタグで様々な感想をいただき、また発表後にも何人もの方が時間が足りず話しきれなかったデータ移行などについて質問しにきてください
こんにちは。サーバサイドエンジニアの松宮です。 今年もScalaMatsuriに参加してきました。そして今年は大名スポンサーとして協賛させて頂きました! 濃い内容のセッションが盛りだくさんで非常に勉強になりましたので、いくつかピックアップしてレポートを書きたいと思います。 ↑ScalaMatsuriに参加したマイクロアドのエンジニアたち 目次 いつかは導入したい、ES + CQRS これからは小まめにCVEをウォッチします・・! 10msの世界で戦うエンジニア必見ですね 関数型プログラミングは技術的にDDDをサポートする CPSとDIはユースケースによって使い分ける また来年! いつかは導入したい、ES + CQRS speakerdeck.com 早速ですが、TIS株式会社の根来さんより「決済サービスで Akka Cluster 使ってみた」のレポートからです。 マイクロアドでもAkka
直観主義論理はカリーハワード対応に見て取れる通り、型付きラムダ計算ほどの単純なモデルが表現できるシンプルな論理ですが、制約も多いのでした。この記事は、より「強い」、つまりより強力な論理である古典論理をどうScalaプログラム内で構築できるのか、について記述します。 Scalaで論理体系を作る話 - 1. 命題論理その1 その前に… 補足 - 証明における禁忌 Scalaプログラム上の証明は、書き方によっては意味を為さなくなります。そのような二つのケースとして、例外を投げることと自分自身を証明に使ってしまう(循環論法)ことの二つが挙げられます。 論理式として、$A$を考えます。これはどのような型Aにも値が存在するという主張であり、本来ならば証明はできません。 例外を投げるというのは、例えば といったものを指します。throw式は型 Nothing を持つため、結果がthrow式になっていると
(sbt標準にあったらしい?ので)下の方に追記したよ! すごく簡単に説明すると、以下のような定義があったときに lazy val a = project lazy val b = project lazy val c = project "a"と"b"の"compile"だけを"並列に"実行したい、みたいな。(cのcompileは実行したくない) なぜかsbt標準にも、外部のsbt pluginでも存在していない気がする・・・?(あったら教えてください) なので、それを書いたのを説明する記事 入社数日にしてsbt職人業務をしてしまった。ていうか、なぜこの機能標準でsbtにないんだ。ちゃんと探せばsbt pluginとしてころがってないかな。 (どういう機能なのか?の説明書くのすらだるいので、明日以降に気が向いたら書く、かもしれない)— Kenji Yoshida (@xuwei_k) 20
2019/1/19 に LINE Fukuoka さんで開催された Scala福岡2019 に参加してきました! 2019/01/19(土)11:00- LINE Fukuoka https://scala-fukuoka.org オープニング 初参加者けっこう多い。 九州外からの参加者も多い。 福岡ではScalaエンジニアがまだ少ないが、CfPには多数応募があった。 基調講演 - いつScalaを使い、いつ使わないのか がくぞさん(Tech to Value) @gakuzzzz Scalaの言語特性と周辺環境のまとめと、Scalaの向き不向きについて。 Scalaの言語特性 静的型付け言語。 クリティカルな用途には、静的型付け言語のほうが向いている。 動的型付け言語は、一部に問題があったとしても全体が動かない状態を避ける思想。 型の表現力は、Javaと比べて高い。 ドメイン駆動設計(D
Scalaの型システムには興味深い型が存在します。Scalaの型で述語論理を表現できないか、表現できるとしたら集合論をScalaで書けてしまわないだろうか、という興味から、Scala-proofsというプロジェクトを立ち上げて実験をしています。この記事は、Scala-proofsの中で使用する論理体系の表現手法について解説します。 Scalaのバージョン間で細かい話が変わってくるようですが、この記事はScala 2.12を前提とします。また、後述する理由から、Dotty/Scala3への移植性をできるだけ高めるために、Dottyで廃止される(予定?)の以下の機能を極力縛ることにします: 抽象HKT1へのワイルドカード_の適用 例えば、F: * -> *の実装が具体的に与えられていない場合、F[_]は型として違法 存在型 F[A] forSome { type A } 抽象型Tからの型投影T
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く