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 OverloadedStrings, FlexibleContexts #-} | |
import Control.Monad.Exception | |
import qualified Data.ByteString.Lazy as B | |
import Data.ByteString.Lazy.Char8 (pack) | |
import System.Environment (getArgs) | |
import JVM.ClassFile | |
import JVM.Assembler | |
import JVM.Builder |
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
// defined on List[A], theoretically | |
def filterM[M](p: A=>M[A]): M[A] = for { | |
flg <- p(this.head) | |
ys <- this.tail.filterM(p) | |
} yield if (flg) this.head :: ys else ys |
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
{-# OPTIONS_GHC -F -pgmF she #-} | |
import Control.Applicative | |
import Control.Concurrent.Async | |
action = (| Concurrently getLine ++ Concurrently getLine |) | |
main = putStrLn =<< runConcurrently action |
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.example | |
import org.eclipse.jetty.server.Server | |
import org.eclipse.jetty.webapp.WebAppContext | |
import org.scalatra.servlet.MultipartConfig | |
object Main { | |
def main(args: Array[String]) { | |
val port = 8080 | |
val server = new Server(port) |
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 Foo { | |
val jedis = new Jedis("localhost") | |
val t1 = jedis.multi | |
t1.hgetAll("bp2local:backplane_server_config") | |
val t2 = jedis.multi | |
t2.get("v2_last_id") | |
t2.exec | |
} |
OlderNewer