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
# AdAway default blocklist | |
# Blocking mobile ad providers and some analytics providers | |
# | |
# Project home page: | |
# https://github.com/AdAway/adaway.github.io/ | |
# | |
# Fetch the latest version of this file: | |
# https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt | |
# | |
# License: |
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 spire.examples | |
import spire.algebra._ | |
import spire.math.{Natural, UInt} | |
import scala.collection.mutable | |
object SetUtil { | |
def powerStream[A](members: Stream[A]): Stream[Set[A]] = { | |
val done = Stream.empty[Set[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
// rank 1 | |
type num[a] = (a => a) => a => a | |
def zero[a]: num[a] = f => x => x | |
def succ[a](n: num[a]): num[a] = f => x => f(n(f)(x)) | |
def eval(n: num[Int]): Int = n(_ + 1)(0) | |
// rank 2 |
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
scala> def foo[A[_]] = 1 | |
foo: [A[_]]=> Int | |
scala> foo[List] | |
res11: Int = 1 | |
scala> foo[Int] | |
<console>:24: error: Int takes no type parameters, expected: one | |
foo[Int] | |
^ |
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 angles | |
import spire.algebra._ | |
import scala.math.Pi | |
object Angle { | |
def apply(n: Double): Angle = | |
if (n < 0.0) new Angle(n % 360.0 + 360.0) else new Angle(n % 360.0) | |
def fromRadians(n: Double): Angle = | |
Angle(n * 360.0 / (2.0 * Pi)) |