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
(ns clj-playground.background | |
(:require [rx.lang.clojure.core :as rx] | |
[rx.lang.clojure.interop :as rxi] | |
[clj-http.client :as http] | |
[monads.core :refer [Monad]] | |
[monads.macros :as monadic]) | |
(:import | |
[java.util.concurrent Executors] | |
[rx Observable] | |
[rx.schedulers Schedulers])) |
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
(be/util-eval-on-load ("evil" "be-scala" "scala-mode2") | |
(evil-define-key 'normal scala-mode-map | |
(kbd ",gi") 'be/init-scala-repl | |
(kbd ",rr") 'be/init-sbt-runner | |
(kbd ",rt") 'be/init-sbt-tester | |
(kbd ",fl") 'be/scala-repl-load-file | |
(kbd ",fr") 'be/scala-repl-load-file | |
(kbd "M-.") 'sbt-find-definitions)) |
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
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Rx.Actor | |
( GenericEvent, EventBus | |
, ActorBuilder, ActorM, ActorDef, Actor, RestartDirective(..), InitResult(..) | |
, SupervisorBuilder, SupervisorStrategy, SupervisorDef, Supervisor | |
-- ^ * Actor Builder API | |
, defActor, actorKey, preStart, postStop, preRestart, postRestart | |
, onError, desc, receive |
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
getLastPublishedMessages :: PubSub -> ClientId -> IO (Either SomeException [WebResponse]) | |
getLastPublishedMessages pubsub cid = do | |
msubject <- getClientSubject pubsub cid | |
case msubject of | |
Just subject -> | |
Observable.toEither . | |
Observable.first . | |
Observable.filter (not . null) . | |
Observable.bufferInterval (Time.microSeconds 1000) . | |
Observable.concatMap excludeClientId $ |
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
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Control.Lens | |
import Control.Monad.Trans (MonadIO(..)) |
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
{-# LANGUAGE ScopedTypeVariables #-} | |
module CloudUtil | |
( module Control.Distributed.Process | |
, cloud | |
, cloudWithRemotable | |
, cloudWithRemotableAsync) | |
where | |
import Control.Exception (try, SomeException, bracket) | |
import Control.Concurrent (threadDelay) |
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
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Maestro.Control.Concurrent.Async | |
( AsyncM(..) | |
, AsyncStep(..) | |
, module Control.Concurrent.Async | |
) where | |
import Control.Monad.Trans (MonadIO(..)) | |
import Control.Monad.Error (MonadError(..)) |
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 Main where | |
main :: IO () | |
main = putStrLn "Hello World" | |
fib 0 = 0 | |
fib 1 = 1 | |
fib n = fib (n - 1) + fib (n - 2) |
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
# Assuming all cabal gen files (myproject.cabal.tmpl, build_depends and test_build_depends) | |
# are in gen/cabal/ folder | |
CABAL_FILE = myproject.cabal | |
CABAL_GEN_FILES = $(wildcard gen/cabal/*) | |
$(CABAL_FILE) : $(CABAL_GEN_FILES) | |
@echo "Building new cabal file" | |
@bin/build_cabal_file.sh \ | |
gen/cabal/maestro-proxy.cabal.tmpl \ |
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 Confetti where | |
type Greeting = String | |
data Hello | |
= NoGreet | |
| Hello { _helloGreet :: Greeting } | |
| Hallo Greeting { _helloGreet :: Greeting } |