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
| class AurumDispatcher extends QueueDispatcher { | |
| val requestMap = new mutable.HashMap[String, BlockingQueue[MockResponse]] | |
| override def dispatch(request: RecordedRequest): MockResponse = { | |
| val key = requestMap.keySet.filter(k => request.getPath.startsWith(k)) | |
| val req: Set[Option[BlockingQueue[MockResponse]]] = key.map(requestMap.get) | |
| val response: Set[Option[MockResponse]] = req.map(optQueue => optQueue.map(q => q.take())) | |
| response.headOption.orNull.orNull.asInstanceOf[MockResponse] | |
| } |
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
| module Main where | |
| import Control.Monad | |
| main :: IO () | |
| main = do putStrLn "Enter the amount of line to read" | |
| s <- readLn :: IO Int | |
| putStrLn ("Now enter " ++ show s ++ " lines ") | |
| elements <- replicateM s getLine | |
| let result = doSomething elements |
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
| While constructing the BuildPlan the following exceptions were encountered: | |
| -- Failure when adding dependencies: | |
| containers: needed (>=0.2 && <0.5), 0.5.6.2 found (latest is 0.5.6.3) | |
| directory: needed (>=1 && <1.2), 1.2.2.0 found (latest is 1.2.4.0) | |
| process: needed (>=1 && <1.2), 1.2.3.0 found (latest is 1.3.0.0) | |
| needed for package: hsc2hs-0.67.20120610 |
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
| Verifying that +volothamp is my blockchain ID. https://onename.com/volothamp |
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
| module Main where | |
| import Data.WAVE | |
| import Control.Monad | |
| import Data.List | |
| main :: IO () | |
| main = do | |
| f <- getWAVEFile "example.wav" | |
| let samples = waveSamples f |
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
| val myGen = for { | |
| a <- arbitrary[String] | |
| b <- arbitrary[String] | |
| c <- arbitrary[String] | |
| d <- arbitrary[String] | |
| } yield MyClass(a, b, c, d) | |
| ============================= Much better | |
| def str = arbitrary[String] |
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
| No instance for (Foldable ((->) a0)) arising from a use of ‘mapM_’ | |
| In a stmt of a 'do' block: mapM_ print log | |
| In the expression: | |
| do { newPlayer1 <- movePlayerLoop player1; | |
| let log1 = initialState ++ ...; | |
| mapM_ print log1; | |
| newPlayer2 <- movePlayerLoop player2; | |
| .... } | |
| In an equation for ‘loop’: | |
| loop initialState player1 player2 |
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.bitgold.services | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.{Future, _} | |
| import scalaz.OptionT._ | |
| import scalaz.Scalaz._ | |
| import scalaz.{OptionT, Scalaz} | |
| class Comparison { |
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.bitgold.services | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.Future | |
| import scalaz.Scalaz._ | |
| class Comparison { | |
| def function1(inputParam: String): Future[Option[String]] = ??? |
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
| module Main where | |
| import Lib | |
| import Data.Maybe | |
| data Product = Product String | |
| deriving (Show, Eq) | |
| data ProductInfo = ProductInfo Product Int | |
| deriving (Show, Eq) |