Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

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

  1. columnSum :: Matrix Double -> Vector Double

    hmatrix-morpheus Numeric.Morpheus.MatrixReduce

    Calculates sums of elements of every column of the given matrix

  2. rowSum :: Matrix Double -> Vector Double

    hmatrix-morpheus Numeric.Morpheus.MatrixReduce

    Calculates sums of elements of every row of the given matrix

  3. leavesUnconsumed :: forall (p :: Type -> Type -> Type) s s' r a . (Source p s s' r, Leftover r s) => r a -> s -> Expectation

    hspec-attoparsec Test.Hspec.Attoparsec

    Checking that the given parser succeeds and yields the given part of the input unconsumed. Intended to be used in conjunction with ~?>

    ("xa" :: Text) ~?> char 'x'
    `leavesUnconsumed` "a"
    

  4. module Kafka.Consumer

    Module to consume messages from Kafka topics. Here's an example of code to consume messages from a topic:

    import Control.Exception (bracket)
    import Control.Monad (replicateM_)
    import Kafka.Consumer
    
    -- Global consumer properties
    consumerProps :: ConsumerProperties
    consumerProps = brokersList ["localhost:9092"]
    <> groupId (ConsumerGroupId "consumer_example_group")
    <> noAutoCommit
    <> logLevel KafkaLogInfo
    
    -- Subscription to topics
    consumerSub :: Subscription
    consumerSub = topics [TopicName "kafka-client-example-topic"]
    <> offsetReset Earliest
    
    -- Running an example
    runConsumerExample :: IO ()
    runConsumerExample = do
    res <- bracket mkConsumer clConsumer runHandler
    print res
    where
    mkConsumer = newConsumer consumerProps consumerSub
    clConsumer (Left err) = pure (Left err)
    clConsumer (Right kc) = (maybe (Right ()) Left) <$> closeConsumer kc
    runHandler (Left err) = pure (Left err)
    runHandler (Right kc) = processMessages kc
    
    -- Example polling 10 times before stopping
    processMessages :: KafkaConsumer -> IO (Either KafkaError ())
    processMessages kafka = do
    replicateM_ 10 $ do
    msg <- pollMessage kafka (Timeout 1000)
    putStrLn $ "Message: " <> show msg
    err <- commitAllOffsets OffsetCommit kafka
    putStrLn $ "Offsets: " <> maybe "Committed." show err
    pure $ Right ()
    

  5. newtype ConsumerGroupId

    hw-kafka-client Kafka.Consumer

    Consumer group ID. Different consumers with the same consumer group ID will get assigned different partitions of each subscribed topic. See Kafka documentation on consumer group

  6. ConsumerGroupId :: Text -> ConsumerGroupId

    hw-kafka-client Kafka.Consumer

    No documentation available.

  7. data ConsumerRecord k v

    hw-kafka-client Kafka.Consumer

    Represents a received message from Kafka (i.e. used in a consumer)

  8. ConsumerRecord :: TopicName -> PartitionId -> Offset -> Timestamp -> Headers -> k -> v -> ConsumerRecord k v

    hw-kafka-client Kafka.Consumer

    No documentation available.

  9. data KafkaConsumer

    hw-kafka-client Kafka.Consumer

    The main type for Kafka consumption, used e.g. to poll and commit messages. Its constructor is intentionally not exposed, instead, one should use newConsumer to acquire such a value.

  10. closeConsumer :: MonadIO m => KafkaConsumer -> m (Maybe KafkaError)

    hw-kafka-client Kafka.Consumer

    Closes the consumer. See newConsumer

Page 213 of many | Previous | Next