This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ReferenceDirective extends Enumeration { | |
val Replace, DoNotReplace = Value | |
def replace: Value = Replace | |
def doNotReplace: Value = DoNotReplace | |
} | |
import java.util.concurrent.atomic._ | |
import scalaz._ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gsa.domain.scala.dan | |
import scalaz.Leibniz.=== | |
import scalaz._ | |
import Scalaz._ | |
import gsa.shared.scala._ //gets you Date, Instant types | |
/** | |
* We wish to use a DomainService to get a snapshot of our domain (e.g. Books and SubBusinessUnits). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object OptionGolf { | |
import scalaz._ | |
import Scalaz._ | |
val moviel = Map("title" -> "South Park", | |
"user" -> "Terrence", | |
"rating" -> "3") | |
val incompleteMovie = Map("name" -> "Jaws") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import scalaz._ | |
import Scalaz._ | |
import test.IRange.Increment | |
sealed trait Limit[+Z] { | |
def open : Boolean | |
def bound : Option[Z] | |
final def closed = !open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<scheme name="OxbowSolarizedDark" version="1" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="1.2" /> | |
<option name="EDITOR_FONT_SIZE" value="13" /> | |
<option name="EDITOR_FONT_NAME" value="Consolas" /> | |
<colors> | |
<option name="ADDED_LINES_COLOR" value="" /> | |
<option name="ANNOTATIONS_COLOR" value="2b36" /> | |
<option name="ANNOTATIONS_MERGED_COLOR" value="" /> | |
<option name="CARET_COLOR" value="dc322f" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) Server VM, Java 1.6.0_18). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> type Tagged[U] = { type Tag = U } | |
defined type alias Tagged | |
scala> type @@[T, U] = T with Tagged[U] | |
defined type alias $at$at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object GOption { | |
def some[A](a: A): GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
def none[A]: GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
} | |
trait GOption[+A] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Monoid[A] { | |
def identity: A | |
def mplus(a1: A, a2: A): A | |
} | |
object Monoid { | |
implicit val IntMonoid = new Monoid[Int] { | |
def identity = 0 | |
def mplus(a1: Int, a2: Int) = a1 + a2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Positions { | |
trait Investment | |
trait Position { | |
def investment: Investment | |
def tradingPnL: Option[Double] | |
def inventoryPnL: Option[Double] | |
final def totalPnL = inventoryPnL → tradingPnL | |
} | |
import Monoid._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TradingDays extends App { | |
import scalaz._ | |
import Scalaz._ | |
case class Trade(sym: String, trader: String, qty: Int) | |
case class TradingDay(symbols: Map[String, SymDay] = Map.empty) | |
object TradingDay { |
OlderNewer