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 Data.Maybe (isNothing, fromJust) | |
import Data.Char (isAlpha, toLower) | |
import Data.List (findIndex) | |
-- charAt xs i = Just x, where x character at index i | |
-- Nothing, is i is out of bounds | |
charAt :: String -> Int -> Maybe Char | |
charAt xs i = if length xs > i then Just (xs !! i) else Nothing | |
-- isVowel x = True if x is a vowel, |
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.vast.utils | |
import akka.actor._ | |
import akka.io.Tcp | |
import play.api.libs.iteratee._ | |
import scala.concurrent.ExecutionContext | |
import spray.http._ | |
import spray.httpx.marshalling.{MarshallingContext, Marshaller} | |
import akka.util.{ByteString, Timeout} | |
import scala.util.control.NonFatal |
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 scala.concurrent.{ ExecutionContext, Future } | |
import shapeless._, ops.tuple.{ IsComposite, LeftFolder, Prepend } | |
object zipAndAdd extends Poly2 { | |
implicit def only[B, A](implicit p: Prepend[B, Tuple1[A]], executor: ExecutionContext) = | |
at[Future[B], Future[A]] { | |
(fb, fa) => fb.zip(fa).map { case (b, a) => p(b, Tuple1(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
package core.dao | |
import scala.concurrent.Future | |
import play.api.Logger | |
import reactivemongo.core.commands.LastError | |
import reactivemongo.core.errors.DatabaseException | |
import core.db.MongoHelper |