Moved to github.com/rafi/notebook
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
/** | |
* In a static language like scala, how could we repeatedly flatten a datastructure without reflection? | |
* This is an interesting example of using implicit parameters to do the work for you. | |
*/ | |
object DeepFlatten { | |
// what should this really be called? ;) | |
trait Flattenable[F[_]] { | |
def flatten[A](f: F[F[A]]): F[A] | |
} |