Hoogle Search

Within LTS Haskell 24.52 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. newThreadStorageMap :: MonadIO m => m (ThreadStorageMap a)

    thread-utils-context Control.Concurrent.Thread.Storage

    Create a new thread storage map. The map is striped by thread into 32 sections in order to reduce contention.

  2. purgeDeadThreads :: MonadIO m => ThreadStorageMap a -> m ()

    thread-utils-context Control.Concurrent.Thread.Storage

    This should generally not be needed, but may be used to remove values prior to GC-triggered finalizers being run from the ThreadStorageMap for threads that have exited.

  3. updateOnThread :: MonadIO m => ThreadStorageMap a -> ThreadId -> (Maybe a -> (Maybe a, b)) -> m b

    thread-utils-context Control.Concurrent.Thread.Storage

    The most general function in this library. Update a ThreadStorageMap on a given thread, with the ability to add or remove values and return some sort of result.

  4. package thread-utils-finalizers

    Perform finalization for threads. Please see the README on GitHub at https://github.com/iand675/thread-finalizers#readme

  5. addThreadFinalizer :: ThreadId -> IO () -> IO ()

    thread-utils-finalizers Control.Concurrent.Thread.Finalizers

    A specialised version of mkWeakThreadIdWithFinalizer, where the Weak object returned is simply thrown away (however the finalizer will be remembered by the garbage collector, and will still be run when the key becomes unreachable).

  6. finalizeThread :: Weak ThreadId -> IO ()

    thread-utils-finalizers Control.Concurrent.Thread.Finalizers

    Run a thread's finalizers. This is just a convenience alias for finalize. The thread can still be used afterwards, it will simply not run the associated finalizers again.

  7. mkWeakThreadIdWithFinalizer :: ThreadId -> IO () -> IO (Weak ThreadId)

    thread-utils-finalizers Control.Concurrent.Thread.Finalizers

    A variant of mkWeakThreadId that supports finalization. Make a weak pointer to a ThreadId. It can be important to do this if you want to hold a reference to a ThreadId while still allowing the thread to receive the BlockedIndefinitely family of exceptions (e.g. BlockedIndefinitelyOnMVar). Holding a normal ThreadId reference will prevent the delivery of BlockedIndefinitely exceptions because the reference could be used as the target of throwTo at any time, which would unblock the thread. Holding a Weak ThreadId, on the other hand, will not prevent the thread from receiving BlockedIndefinitely exceptions. It is still possible to throw an exception to a Weak ThreadId, but the caller must use deRefWeak first to determine whether the thread still exists.

  8. fastspread :: (a -> t -> Pattern b) -> [a] -> t -> Pattern b

    tidal-core Sound.Tidal.UI

    fastspread works the same as spread, but the result is squashed into a single cycle. If you gave four values to spread, then the result would seem to speed up by a factor of four. Compare these two:

    d1 $ spread chop [4,64,32,16] $ sound "ho ho:2 ho:3 hc"
    d1 $ fastspread chop [4,64,32,16] $ sound "ho ho:2 ho:3 hc"
    
    There is also slowspread, which is an alias of spread.

  9. slowspread :: (a -> t -> Pattern b) -> [a] -> t -> Pattern b

    tidal-core Sound.Tidal.UI

    An alias for spread consistent with fastspread.

  10. spread :: (a -> t -> Pattern b) -> [a] -> t -> Pattern b

    tidal-core Sound.Tidal.UI

    The spread function allows you to take a pattern transformation which takes a parameter, such as slow, and provide several parameters which are switched between. In other words it "spreads" a function across several values. Taking a simple high hat loop as an example:

    d1 $ sound "ho ho:2 ho:3 hc"
    
    We can slow it down by different amounts, such as by a half:
    d1 $ slow 2 $ sound "ho ho:2 ho:3 hc"
    
    Or by four thirds (i.e. speeding it up by a third; 4%3 means four over three):
    d1 $ slow (4%3) $ sound "ho ho:2 ho:3 hc"
    
    But if we use spread, we can make a pattern which alternates between the two speeds:
    d1 $ spread slow [2,4%3] $ sound "ho ho:2 ho:3 hc"
    
    Note that if you pass ($) as the function to spread values over, you can put functions as the list of values. (spreadf is an alias for spread ($).) For example:
    d1 $ spread ($) [density 2, rev, slow 2, striate 3, (# speed "0.8")]
    $ sound "[bd*2 [~ bd]] [sn future]*2 cp jvbass*4"
    
    Above, the pattern will have these transforms applied to it, one at a time, per cycle:
    • cycle 1: density 2 - pattern will increase in speed
    • cycle 2: rev - pattern will be reversed
    • cycle 3: slow 2 - pattern will decrease in speed
    • cycle 4: striate 3 - pattern will be granualized
    • cycle 5: (# speed "0.8") - pattern samples will be played back more slowly
    After (# speed "0.8"), the transforms will repeat and start at density 2 again.

Page 733 of many | Previous | Next