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 ImplicitParams { | |
| trait C[A] | |
| } |
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
| (1 to 10).foreach{x => | |
| (1 to 10).foreach{y => | |
| print(x * y+ "\t") | |
| } | |
| println() | |
| } |
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 M[T] { | |
| implicit val m: Manifest[T] | |
| } | |
| case class Point(x: Int, y: Int) | |
| object Main extends M[Point] { | |
| implicit lazy val m: Manifest[Point] = manifest[Point] | |
| def main(args: Array[String]) { | |
| m |
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
| use std::fmt; | |
| use List::{Cons, Nil}; | |
| enum List<T> { | |
| Cons(T, Box<List<T>>), | |
| Nil | |
| } | |
| impl<T> fmt::Display for List<T> where T : fmt::Display { | |
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
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
| use std::fmt; | |
| use List::{Cons, Nil}; | |
| enum List<T> { | |
| Cons(T, Box<List<T>>), | |
| Nil | |
| } | |
| impl<T> fmt::Display for List<T> where T : fmt::Display { | |
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
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
| use std::fmt; | |
| use List::{Cons, Nil}; | |
| use std::sync::Arc; | |
| enum List<T> { | |
| Cons(T, Arc<List<T>>), | |
| Nil | |
| } | |
| impl<T> fmt::Display for List<T> where T : fmt::Display { |
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
| use std::fmt; | |
| use List::{Cons, Nil}; | |
| use std::sync::Arc; | |
| enum List<T> { | |
| Cons(T, Arc<List<T>>), | |
| Nil | |
| } | |
| impl<T> fmt::Display for List<T> where T : fmt::Display { |
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
| use std::fmt; | |
| use List::{Cons, Nil}; | |
| use std::sync::Arc; | |
| enum List<T> { | |
| Cons(T, Arc<List<T>>), | |
| Nil | |
| } | |
| impl<T> fmt::Display for List<T> where T : fmt::Display { |
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
| use std::fmt; | |
| use List::{Cons, Nil}; | |
| use std::sync::Arc; | |
| #[derive(PartialEq, Clone)] | |
| enum List<T> { | |
| Cons(T, Arc<List<T>>), | |
| Nil | |
| } | |
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
| use std::fmt; | |
| use List::{Cons, Nil}; | |
| use std::sync::Arc; | |
| #[derive(PartialEq, Clone)] | |
| enum List<T> { | |
| Cons(T, Arc<List<T>>), | |
| Nil | |
| } | |
OlderNewer