Giter Site home page Giter Site logo

pimpathon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pimpathon's Issues

Add Map pimps

valueForMaxKey, valueForMinKey, keyForMaxValue, keyForMinValue

Add any.applyAll

def applyAll(fns: (T ⇒ T)*): T = Function.chain(fns)(value)

Add Map.partitionKeysBy

def partitionBy[C](pf: PartialFunction[K, C]): (Map[C, V], Map[K, V])

pf: PartialFunction[K, C]

Add Map.sortByValues (sortValuesBy)

// Have to use map.get because even though we can safely call map.apply when sorting the map, the ordering is ALSO
// used to implement 'contains'
def sortByValues(implicit ordering: Ordering[V]): SortedMap[K, V] = sorted(Ordering.OptionV.on(map.get))

Add Any.compareTo

def compareTo(other : T)(implicit ev : Ordering[T]) = ev.compare(value, other)

CI goodness

Some notes on how we setup a nice workflow in ENSIME:

You'll need to temporarily comment out lines 4 and 5 of the travis config (enabling CI on other branches) until you have created those branches.

Option.getOrThrow

I often find myself wanting to use this pattern:

option.getOrElse(throw new IllegalArgumentException("some meaningful message"))

it would be great to be able to do

option.getOrThrow("some meaningful message")

perhaps with a String => Throwable curried parameter to allow users to change the kind of exception that is thrown (IAE default)

Add Either.tap

def tap[LV, RV](left: L => LV, right: R => RV): Either[L, R] = { either.fold(left, right); either }

Add Predicate.ifSome

def ifSome: (Option[A]) ⇒ Boolean = (oa: Option[A]) ⇒ oa.fold(a ⇒ (f(a), false)

Add Map.collectKeys

def collectKeys[C](pf: PartialFunction[K, C]): Map[C, V]
def collectKeysO[C](f: K ⇒ Option[C]): Map[C, V]

Add Map.collectValues

def collectValues[W](pf: PartialFunction[V, W]): Map[K, W]
def collectValuesO[W](f: V ⇒ Option[W]): Map[K, W]

Add Map.sortKeysBy

def sortKeysBy[S](f: K ⇒ S)(implicit ordering: Ordering[S]): SortedMap[K, V]

Add Map.sorted

def sorted(implicit ordering: Ordering[K]): SortedMap[K, V]

Add Either.map

def map[LV, RV](left: L => LV, right: R => RV): Either[LV, RV] = either.fold(l => Left(left(l)), r => Right(right(r)))

Add Traversable pimps

def attributeCounts[B](f: A => B): Map[B, Int]
def optAttributeCounts[B](f: A => Option[B]): Map[B, Int]
def collectAttributeCounts[B](pf: PartialFunction[A, B]): Map[B, Int]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.