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
trait Z | |
trait N[X] | |
trait L[X] | |
trait Qlr[X] | |
trait Qrl[X] | |
trait E[X] extends AnyRef with Qlr[N[_ >: Qr[_ >: E[_ >: E[_ >: X]]]]] with Qrl[N[_ >: Ql[_ >: E<_ >: E[_ >: X]]]] | |
trait Ql[X] extends AnyRef with L[N[_ >: Ql[_ >: L[_ >: N[_ >: X]]]]] with E[Qlr[_ >: N[_ >: X]]] | |
trait Qr[X] extends AnyRef with L[N[_ >: Qr[_ >: L[_ >: N[_ >: X]]]]] with E[Qrl[_ >: N[_ >: X]]] | |
object Undecidable { | |
def doIt(v: Qr[_ >: E[_ >: E[_ >: Z]]]): L[_ >: N[_ >: L[_ >: N[_ >: L[_ >: N[_ >: E[_ >: E[_ >: Z]]]]]]]] = v |
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
package scala | |
abstract sealed class Boolean extends AnyVal { | |
def && (p: => Boolean): Boolean = // boolean and | |
if (this) p else false | |
def || (p: => Boolean): Boolean = // boolean or | |
if (this) true else p | |
def & (x: Boolean): Boolean = // boolean strict and | |
if (this) x else false | |
def | (x: Boolean): Boolean = // boolean strict or | |
if (this) true else x |
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
object O { | |
def f: Int = 0 | |
def f(x: Int): Int = x | |
def main(args: Array[String]): Unit = { | |
println(f) | |
println(f(3)) | |
} | |
} |
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
abstract class ParseResult<T> { | |
String next; | |
ParseResult(this.next) {} | |
T get value; | |
bool get successful; | |
} | |
class Pair<T1, T2> { | |
T1 item1; |
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
[mizushima]$ dartanalyzer generics.dart | |
Analyzing generics.dart... | |
error • Missing parameter type for 'x' at generics.dart:13:37 • strong_mode_implicit_dynamic_parameter | |
1 error found. |
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
array.reduce((sum, x) => sum + x, 0) // 0はあえて明示した |
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
package com.github.kmizu.play_json_example | |
import play.api.libs.json._ | |
object Main { | |
implicit class RichWrites[A](w: Writes[A]) { | |
def ignore(ignoreFields: String*): Writes[A] = { | |
w.transform{ | |
case JsObject(fields) => JsObject(fields.filterNot { | |
case (k, _) => ignoreFields.contains(k) | |
}) |
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
using Nemerle.Compiler; | |
macro @==(lhs, rhs) { | |
<[ | |
true | |
]> | |
} |
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
tyseq ::= tywotseq | |
| (ty1,...,tyn) | |
ty ::= tywotseq | |
| tyseq longtycon | |
| ( ty ) | |
tywotseq ::= tyvar | |
| { <tyrow> } | |
| tywoarrow -> ty | |
| ( ty ) |
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 time | |
def main(): | |
start = time.time() | |
z = 0 | |
for i in range(0, 100000000): | |
z += 1 | |
print(z) | |
end = time.time() | |
print(end - start) |