This file contains hidden or 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
import shapeless._ | |
object cz { | |
trait ConstZipper[L <: HList, C] extends DepFn2[L, C] { type Out <: HList } | |
object ConstZipper { | |
type Aux[L <: HList, C, Out0 <: HList] = | |
ConstZipper[L, C] { type Out = Out0 } |
This file contains hidden or 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
import shapeless._ | |
import poly._ | |
import shapeless.ops.hlist.FlatMapper | |
object am { | |
/** | |
* A type class that helps us partially apply a polymorphic binary function | |
* to some value and map the resulting function (which of course isn't | |
* literally a Poly1) over an HList. |
This file contains hidden or 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
import java.io.File | |
import scala.io._ | |
import scala.util.matching.Regex | |
def recursiveListFiles(f: File, r: Regex): Array[File] = { | |
val these = f.listFiles | |
val good = these.filter(f => r.findFirstIn(f.getName).isDefined) | |
good ++ these.filter(_.isDirectory).flatMap(recursiveListFiles(_,r)) | |
} | |
NewerOlder