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
/** | |
* Exercises explaining covariant and contravariant functors. | |
* | |
* Additionally exercises explaining variance of types over their type parameters. | |
* | |
* Implement the `???` functions. Are all implementable? | |
*/ | |
trait Functors { | |
/** |
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
import java.util.concurrent.ConcurrentHashMap | |
object Why { | |
val data = new ConcurrentHashMap[Int, String] | |
def update(int: Int, str: String): Unit = { | |
data.put(int, str) | |
} | |
} |
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
-- https://haskell.fpcomplete.com/user/DanBurton/20-intermediate-exercises | |
-- Originally from http://blog.tmorris.net/posts/20-intermediate-haskell-exercises/ | |
class Fluffy f where | |
furry :: (a -> b) -> f a -> f b | |
-- Exercise 1 | |
-- Relative Difficulty: 1 | |
instance Fluffy [] where | |
furry = fmap |
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
backpack | |
pack cover | |
hiking poles | |
sleeping bag | |
sleeping pad | |
tent | |
water bottles | |
camelback | |
water purification system |
NewerOlder