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
with builtins; rec { | |
cabalProjects = listToAttrs (if pathExists ./cabal.project | |
then projectParse | |
else [ { name = baseNameOf ./.; value = ./.; } ] ); | |
projectParse = let | |
contents = readFile ./cabal.project; | |
trimmed = replaceStrings ["packages:" " "] ["" ""] contents; | |
packages = filter (x: isString x && x != "") (split "\n" trimmed); | |
package = p: substring 0 (stringLength p - 1) p; | |
paths = map (p: let p' = package p; in { name = p'; value = toPath (./. + "/${p'}"); } ) packages; |
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
#!/usr/bin/env stack | |
{- stack | |
--resolver lts-6.27 | |
--install-ghc | |
runghc | |
--package containers | |
-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE DataKinds #-} |
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
scala> trait Assoc[K] { type V ; val value: V } | |
defined trait Assoc | |
scala> def mkAssoc[V0](k: String, v: V0): Assoc[k.type] { type V = V0 } = | |
| new Assoc[k.type] { type V = V0 ; val value = v } | |
mkAssoc: [V0](k: String, v: V0)Assoc[k.type]{type V = V0} | |
scala> implicit def nameAssoc = mkAssoc("Name", "Mary") | |
nameAssoc: Assoc[String("Name")]{type V = String} |
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
public class GetEventStoreEventDispatcher | |
{ | |
private const int RECONNECT_TIMEOUT_MILLISEC = 5000; | |
private const int THREAD_KILL_TIMEOUT_MILLISEC = 5000; | |
private const int READ_PAGE_SIZE = 500; | |
private const int LIVE_QUEUE_SIZE_LIMIT = 10000; | |
private readonly IEventBus _eventBus; | |
private readonly EventStoreConnection _store; |