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
fizzbuzz :: Int -> [String] | |
fizzbuzz n = map fb [1..n] | |
where fb x | |
| x `mod` 15 == 0 = "fizzbuzz" | |
| x `mod` 5 == 0 = "buzz" | |
| x `mod` 3 == 0 = "fizz" | |
| otherwise = show x |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd"> | |
<module rename-to="hello"> | |
<inherits name="com.google.gwt.user.User" /> | |
<inherits name='com.google.gwt.query.Query' /> | |
<source path="client" /> | |
<entry-point class="as.client.Hello"></entry-point> | |
</module> |
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
package nyao.client | |
import com.google.gwt.user.client.rpc.AsyncCallback | |
class ConfigurableAsyncCallback<T> implements AsyncCallback<T> { | |
def static <T> AsyncCallback<T> onSuccess((T)=>void onSuccess) { | |
val x = new ConfigurableAsyncCallback<T>() | |
x.onSuccessDo(onSuccess) | |
return x |
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
class CondOp(val a: Boolean) { | |
def |||(b: => Boolean) = if (a) a else b | |
} | |
object Main { | |
def main(args: Array[String]) { | |
implicit def boolWrapper(cond: Boolean) = new CondOp(cond) | |
true ||| { println("hoge"); false } | |
false ||| { println("foo"); true} |
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 akka.actor._ | |
class HogeActor extends Actor { | |
def receive = { | |
case i:Int => println("Int=" + i) | |
case hoge:Hoge => println("your name is " + hoge.name) | |
case _ => sender ! "received something." | |
} | |
} |
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
module Server | |
open Lemon | |
open System.Collections.Generic | |
let todolist = ResizeArray<string>() | |
let (|Int|_|) (str: string) = | |
match System.Int32.TryParse(str) with | |
| true, x -> Some x |