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 language.experimental.macros | |
| import scala.reflect.macros.Context | |
| object Macros { | |
| def nonHygienicA(): Int = macro MacrosImpl.nonHygienicAImpl | |
| def hygienicA(): Int = macro MacrosImpl.hygienicAImpl | |
| } |
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
| type DP = (T, T => Boolean) forSome { type T } |
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
| {-# LANGUAGE ExistentialQuantification #-} | |
| data DP = forall a. DP a (a -> Bool) |
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
| def foo[B](f[A]: A => List[A], b: B, c: Int) = (f(b), f(c)) |
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
| def foo[A, B](f: A => List[A], b: B, c: Int) = (f(b), f(c)) |
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
| foo2 :: forall a b. (a -> [a]) -> b -> Int -> ([b], [Int]) | |
| foo2 f b c = ((f b), (f c)) | |
| bar2 :: forall b. (forall a. a -> [a]) -> b -> Int -> ([b], [Int]) | |
| bar2 f b c = ((f b), (f c)) |
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
| {-# LANGUAGE RankNTypes #-} | |
| bar :: (forall a. a -> [a]) -> b -> Int -> ([b], [Int]) | |
| bar f b c = ((f b), (f c)) |
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
| foo :: (a -> [a]) -> b -> Int -> ([b], [Int]) | |
| foo f b c = ((f b), (f c)) |
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
| (List("hoge"), List(1)) |
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
| foo(toList, "hoge", 1) |