Skip to content

Commit

Permalink
Fixed complier warnings and bumped scala version to 2.11.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ezoerner committed Nov 13, 2015
1 parent 9b1e5d7 commit 44e01a7
Show file tree
Hide file tree
Showing 29 changed files with 58 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import monads.Functor
import state._
import State._
import monoids._
import language.higherKinds
import language.implicitConversions


trait Applicative[F[_]] extends Functor[F] {
// `map2` is implemented by first currying `f` so we get a function
Expand Down
3 changes: 3 additions & 0 deletions answers/src/main/scala/fpinscala/iomonad/BindTest.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package fpinscala.iomonad

import language.higherKinds
import language.postfixOps

object BindTest extends App {

def timeit(n: Int)(task: => Unit): Unit = {
Expand Down
4 changes: 4 additions & 0 deletions answers/src/main/scala/fpinscala/iomonad/IO.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package fpinscala.iomonad

import scala.io.StdIn.readLine
import language.higherKinds
import language.postfixOps

object IO0 {
/*
Expand Down
1 change: 1 addition & 0 deletions answers/src/main/scala/fpinscala/iomonad/Monad.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fpinscala.iomonad

import language.higherKinds // Disable warnings for type constructor polymorphism
import language.implicitConversions

trait Functor[F[_]] {
def map[A,B](a: F[A])(f: A => B): F[B]
Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/iomonad/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package fpinscala

import language.higherKinds

package object iomonad {
import fpinscala.parallelism.Nonblocking._

Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/monads/Monad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import testing._
import parallelism._
import state._
import parallelism.Par._
import language.higherKinds


trait Functor[F[_]] {
def map[A,B](fa: F[A])(f: A => B): F[B]
Expand Down
1 change: 1 addition & 0 deletions answers/src/main/scala/fpinscala/monoids/Monoid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fpinscala.monoids

import fpinscala.parallelism.Nonblocking._
import fpinscala.parallelism.Nonblocking.Par.toParOps // infix syntax for `Par.map`, `Par.flatMap`, etc
import language.higherKinds

trait Monoid[A] {
def op(a1: A, a2: A): A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fpinscala.parallelism

import java.util.concurrent.{Callable, CountDownLatch, ExecutorService}
import java.util.concurrent.atomic.AtomicReference
import language.implicitConversions

object Nonblocking {

Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/parallelism/Par.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package fpinscala.parallelism

import java.util.concurrent._
import language.implicitConversions


object Par {
type Par[A] = ExecutorService => Future[A]
Expand Down
3 changes: 3 additions & 0 deletions answers/src/main/scala/fpinscala/parsing/JSON.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package fpinscala.parsing

import language.higherKinds
import language.implicitConversions

trait JSON

object JSON {
Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import java.util.regex._
import scala.util.matching.Regex
import fpinscala.testing._
import fpinscala.testing.Prop._
import language.higherKinds
import language.implicitConversions

trait Parsers[Parser[+_]] { self => // so inner classes may call methods of trait
def run[A](p: Parser[A])(input: String): Either[ParseError,A]
Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/streamingio/MonadCatch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package fpinscala.streamingio

import fpinscala.iomonad._

import language.higherKinds

/*
* A context in which exceptions can be caught and
* thrown.
Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/streamingio/Partial.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package fpinscala.streamingio

import language.higherKinds

/*
* A context in which exceptions can be caught and
* thrown.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package fpinscala.streamingio

import fpinscala.iomonad.{IO,Monad,Free,unsafePerformIO}
import language.implicitConversions
import language.higherKinds
import language.postfixOps

object ImperativeAndLazyIO {

Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/streamingio/These.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package fpinscala.streamingio

import language.postfixOps

/* Data type representing either A, B, or both A and B. */
trait These[+A,+B] {
import These._
Expand Down
3 changes: 3 additions & 0 deletions answers/src/main/scala/fpinscala/testing/Exhaustive.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package fpinscala.testing.exhaustive

import language.implicitConversions
import language.postfixOps

/*
This source file contains the answers to the last two exercises in the section
"Test Case Minimization" of chapter 8 on property-based testing.
Expand Down
2 changes: 2 additions & 0 deletions answers/src/main/scala/fpinscala/testing/Gen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import fpinscala.parallelism.Par.Par
import Gen._
import Prop._
import java.util.concurrent.{Executors,ExecutorService}
import language.postfixOps
import language.implicitConversions

case class Prop(run: (MaxSize,TestCases,RNG) => Result) {
def &&(p: Prop) = Prop {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import state._
import State._
import StateUtil._ // defined at bottom of this file
import monoids._
import language.higherKinds
import language.implicitConversions

trait Applicative[F[_]] extends Functor[F] {

Expand Down
4 changes: 4 additions & 0 deletions exercises/src/main/scala/fpinscala/iomonad/IO.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package fpinscala.iomonad

import language.postfixOps
import language.higherKinds
import scala.io.StdIn.readLine

object IO0 {
/*
Expand Down
1 change: 1 addition & 0 deletions exercises/src/main/scala/fpinscala/iomonad/Monad.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fpinscala.iomonad

import language.higherKinds // Disable warnings for type constructor polymorphism
import language.implicitConversions

trait Functor[F[_]] {
def map[A,B](a: F[A])(f: A => B): F[B]
Expand Down
2 changes: 2 additions & 0 deletions exercises/src/main/scala/fpinscala/iomonad/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package fpinscala

import language.higherKinds

package object iomonad {
import fpinscala.parallelism.Nonblocking._

Expand Down
2 changes: 2 additions & 0 deletions exercises/src/main/scala/fpinscala/monads/Monad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import testing._
import parallelism._
import state._
import parallelism.Par._
import language.higherKinds


trait Functor[F[_]] {
def map[A,B](fa: F[A])(f: A => B): F[B]
Expand Down
1 change: 1 addition & 0 deletions exercises/src/main/scala/fpinscala/monoids/Monoid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fpinscala.monoids

import fpinscala.parallelism.Nonblocking._
import fpinscala.parallelism.Nonblocking.Par.toParOps // infix syntax for `Par.map`, `Par.flatMap`, etc
import language.higherKinds

trait Monoid[A] {
def op(a1: A, a2: A): A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fpinscala.parallelism

import java.util.concurrent.{Callable, CountDownLatch, ExecutorService}
import java.util.concurrent.atomic.AtomicReference
import language.implicitConversions

object Nonblocking {

Expand Down
1 change: 1 addition & 0 deletions exercises/src/main/scala/fpinscala/parallelism/Par.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fpinscala.parallelism

import java.util.concurrent._
import language.implicitConversions

object Par {
type Par[A] = ExecutorService => Future[A]
Expand Down
5 changes: 1 addition & 4 deletions exercises/src/main/scala/fpinscala/parsing/Parsers.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package fpinscala.parsing

import java.util.regex._
import scala.util.matching.Regex
import fpinscala.testing._
import fpinscala.testing.Prop._
import language.higherKinds

trait Parsers[Parser[+_]] { self => // so inner classes may call methods of trait

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fpinscala.streamingio

import fpinscala.iomonad._
import language.higherKinds

/*
* A context in which exceptions can be caught and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package fpinscala.streamingio

import fpinscala.iomonad.{IO,Monad,Free,unsafePerformIO}
import language.implicitConversions
import language.higherKinds
import language.postfixOps

object ImperativeAndLazyIO {

Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Keys._

object FPInScalaBuild extends Build {
val opts = Project.defaultSettings ++ Seq(
scalaVersion := "2.11.5",
scalaVersion := "2.11.7",
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
)

Expand Down

0 comments on commit 44e01a7

Please sign in to comment.