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.
columnSum :: Matrix Double -> Vector Doublehmatrix-morpheus Numeric.Morpheus.MatrixReduce Calculates sums of elements of every column of the given matrix
rowSum :: Matrix Double -> Vector Doublehmatrix-morpheus Numeric.Morpheus.MatrixReduce Calculates sums of elements of every row of the given matrix
-
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" -
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 ()
-
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
ConsumerGroupId :: Text -> ConsumerGroupIdhw-kafka-client Kafka.Consumer No documentation available.
-
hw-kafka-client Kafka.Consumer Represents a received message from Kafka (i.e. used in a consumer)
-
hw-kafka-client Kafka.Consumer No documentation available.
-
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.
closeConsumer :: MonadIO m => KafkaConsumer -> m (Maybe KafkaError)hw-kafka-client Kafka.Consumer Closes the consumer. See newConsumer