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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: BCPG v1.51 | |
mQENBFa008UBCACp9mGyIyJ4+56TtMFNQLcUJwDd9I+I1Xt5rEL8k58GKEpsunWp | |
P1N7vfZOr0UcLtm+bKTNsKYiIMztqZAJVLEIRlQc1/3l53Bpwozzf3Ta+XZ6pIzG | |
RjNyVGyufKRmpyk6fy8bZ97/ZjmwuKM/1NbCC2HKY5UIOUhVhoFwnqQQRCEOZmme | |
/2eCamGE6KdDblXo7b+oobBtkZUvBCr/RIspGDQaxyyghttwaaCWDUKf/wV1JTDw | |
47bn8nt5149YONXor/AIoAzwNWw6dsYNRklfSPQARVJ5AAG5uK+s3nyUe4KJHUll | |
TKLRgTKBgyFPhfcILNCb4BFUS+92w2tLepcLABEBAAG0J1BhdWwgQ2hpdXNhbm8g | |
PHBhdWwuY2hpdXNhbm9AZ21haWwuY29tPokBHAQTAQIABgUCVrTTxQAKCRDgp4oY |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl7vQYUMJCI3w3nMae/ojbMttxioFhRl8irKMnhVYq7clNvvY9vNZchtOP0eX/a+qh31/WI8OA98p9bMALX4PU0D2GI123e6Yn5TxUdY9GaizHwuw5w0CbkDWiHmRQUq7HZHOit0qw146Dx00StdENccdUtBrPEPaUY5Z/fb7rvJW2CdCX956QaJMm1T3TTGFUfU+Lm1NsnQzw+eL1P7o2ePrf4wXLb90y6/k43VmZyIyRN1XdR8AKXemaLNh2INOCRlFTxGknJyJD4HTzPKfAptkyFi3nCjyHzgKz1zHhvsw4OEEdQ3Nbzxwx5TE1vSd/XfMbrvHtRgwIoR536N8F [email protected] |
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
package fs2.internal | |
import java.util.concurrent.atomic._ | |
/** A reference which may be updated transactionally, without use of `==` on `A`. */ | |
private[fs2] class Ref[A](id: AtomicLong, ref: AtomicReference[A]) { | |
/** | |
* Obtain a snapshot of the current value, and a setter | |
* for updating the value. The setter may noop (in which case `false` | |
* is returned) if another concurrent call to `access` uses its |
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
def liftFirst[F[_],A,B,C](f: Process1[A,B]): Process1[(A,C),(B,C)] = { | |
def go(cs: Chunk[C], s: Stepper[A,B]): Handle[Pure,(A,C)] => Pull[Pure,(B,C),Unit] = h => | |
s.step match { | |
case Stepper.Done => Pull.done | |
case Stepper.Fail(err) => Pull.fail(err) | |
case Stepper.Emits(chunk, next) => | |
if (cs.isEmpty) go(cs, next)(h) | |
else { | |
val last = cs(cs.size - 1) |
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
package fs2.async.mutable | |
import fs2.async.AsyncExt | |
/** A nonblocking semaphore, useful as a concurrency primitive. */ | |
trait Semaphore[F[_]] { | |
/** Returns the number of permits currently available for acquisition. Always nonnegative. */ | |
def available: F[Long] |
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
package fs2 | |
import util.Monad | |
import Step._ | |
import java.util.concurrent.atomic.AtomicLong | |
object diamond { | |
/** | |
* Pass elements of `s` through both `f` and `g`, then combine the two resulting streams. |
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 ReflexHelpers where | |
import Control.Monad.IO.Class | |
import Reflex | |
import Reflex.Dom | |
evaluate :: (MonadWidget t m, Reflex t) => (a -> IO b) -> Event t a -> m (Event t b) | |
evaluate f actions = performEvent $ fmap (liftIO . f) actions | |
now :: (MonadWidget t m, Reflex t) => a -> m (Event t a) |
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
/** | |
* A Map which tracks the insertion order of entries, so that entries may be | |
* traversed in the order they were inserted. Uses just two purely functional | |
* maps. | |
*/ | |
import scala.collection.immutable.LongMap | |
class LinkedMap[K,V]( | |
entries: Map[K,(V,Long)], |
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
searchbox <- textInput def | |
let isArrow i = i == 38 || i == 40 | |
let tweak e = e >>= \i -> if isArrow i then i <$ preventDefault else pure i | |
tweakedKeydown <- wrapDomEvent (_textInput_element searchbox) elementOnkeydown (tweak getKeyEvent) | |
_ <- widgetHold (pure ()) (fmap (const (pure ())) tweakedKeydown) |
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 TypeFamilies #-} | |
module Pcbt where | |
import Prelude hiding (lookup) | |
import Data.Set (Set) | |
import Data.Map (Map) | |
import qualified Data.Set as Set | |
import qualified Data.Map.Strict as Map | |
import Data.Maybe |