タグ

scalaに関するxorphitusのブックマーク (5)

  • 【Scala】flatMap は怖くない! | DevelopersIO

    ここで注意が必要なのは「型引数をとる全てのクラス(全ての総称型) ≠ 文脈付きの値」ということです。型引数をとり、文脈付きの値とはいえないクラスも存在します。 たとえば SeqFactory[A] は、 Seq のサブクラス A を生成するファクトリであり、 文脈付きの値ではありません。もっと身近な例を上げると、わたし達が普段よく目にしている(であろう) Provider[A] や Publisher[A] というインターフェイスも、それぞれ「Aを提供するもの」「Aを発行するもの」という意味であり、Aという値を修飾しているわけではないので文脈付きの値とは呼びません。 文脈付きの値を返す関数 親友検索を考える さて、文脈付きの値がどのようなものかわかってきたところで、実際に文脈付きの値を生成する関数を作ってみましょう。 …などと大げさに言ってみましたが、そんなもの、今までだってたくさん作って

    【Scala】flatMap は怖くない! | DevelopersIO
  • Scala.js

    Scala.js 1.15.0 Harness the Scala and JavaScript ecosystems together. Develop robust apps for browsers, Node.js, and serverless. Strong typing guarantees your code is free of silly mistakes; no more mixing up strings or numbers, forgetting what keys an object has, or worrying about typos in your method names. Scala.js takes care of all this tedious book-keeping for you, letting you focus on the ac

    Scala.js
    xorphitus
    xorphitus 2014/02/25
    関数型、JVM、JavaScriptにコンパイル…折角だから俺はこのClojureScriptを選ぶぜ(違)
  • GitHub - mame/quine-relay: An uroboros program with 100+ programming languages

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

    GitHub - mame/quine-relay: An uroboros program with 100+ programming languages
    xorphitus
    xorphitus 2013/07/16
    こ、これは・・・!
  • Comprehending Monads

    What's a monad? What's a monad? trait Monad[A] { def map[B](f: A => B): Monad[B] def flatMap[B](f: A => Monad[B]): Monad[B] } Note: there is no single, special Monad base trait! Provides a standard interface for composing and sequencing operations on some contained value(s) map: Applies a "regular" function to the contained value(s) flatMap: Applies a "monadic" function to the contained value(s) T

  • Effective Scala

    Effective Scala Marius Eriksen, Twitter Inc. marius@twitter.com (@marius) [translated by Yuta Okamoto (@okapies) and Satoshi Kobayashi (@scova0731)] Table of Contents 序章 書式: ホワイトスペース, 命名, インポート, 中カッコ, パターンマッチ, コメント 型とジェネリクス: 戻り型アノテーション, 変位, 型エイリアス, 暗黙 コレクション: 階層, 使う, スタイル, 性能, Java コレクション 並行性: Future, コレクション 制御構造: 再帰, Return, forループと内包, require と assert 関数型プログラミング: 代数的データ型としてのケースクラス, Option, パターンマ

    Effective Scala
    xorphitus
    xorphitus 2012/05/09
    TwitterによるScalaのベストプラクティス日本語訳
  • 1