13.07.2015 Aufrufe

Monaden & Co. Funktionale Konzepte in Scala - Lars Hupel

Monaden & Co. Funktionale Konzepte in Scala - Lars Hupel

Monaden & Co. Funktionale Konzepte in Scala - Lars Hupel

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

Typklassen <strong>in</strong> <strong>Scala</strong> – ImplementationnImplementation als Wert oder Funktionval floatNumeric = new Numeric[Float] {def add(a1: Float, a2: Float) = a1 + a2def neg(a: Float) = -aval zero: Float = 0.0f}def tupleNumeric[A, B](na: Numeric[A], nb: Numeric[B]) =new Numeric[(A, B)] {def add(a1: (A, B), a2: (A, B)) = …}<strong>Monaden</strong> & <strong>Co</strong>. – <strong>Lars</strong> <strong>Hupel</strong> <strong>Co</strong>pyright © 2011 MATHEMA Software GmbH 9

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!