say alternatives and similar packages
Based on the "Text" category.
Alternatively, view say alternatives based on common mentions on social networks and blogs.
-
pandoc-citeproc
Library and executable for using citeproc with pandoc -
scholdoc
Fork of Pandoc for the implementation of a ScholarlyMarkdown parser -
blaze-from-html
A blazingly fast HTML combinator library for Haskell. -
skylighting
A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions -
commonmark
Pure Haskell commonmark parsing library, designed to be flexible and extensible -
regex-genex
Given a list of regexes, generate all possible strings that matches all of them. -
regex-applicative
Regex-based parsing with an applicative interface -
pandoc-csv2table
A Pandoc filter that renders CSV as Pandoc Markdown Tables. -
servant-checked-exceptions
type-level errors for Servant APIs. -
double-conversion
A fast Haskell library for converting between double precision floating point numbers and text strings. It is implemented as a binding to the V8-derived C++ double-conversion library. -
text-format
A Haskell text formatting library optimized for ease of use and high performance. -
diagrams-pandoc
A pandoc filter to express diagrams inline using the haskell EDSL diagrams. -
boxes
A pretty-printing library for laying out text in two dimensions, using a simple box model. -
hyphenation
Knuth-Liang Hyphenation for Haskell based on TeX hyphenation files
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of say or a related project?
README
say
Send textual messages to a Handle
in a thread-friendly way.
The motivation for this package is described in a blog post on Haskell's
Missing Concurrency
Basics.
The simple explanation is, when writing a line of textual data to a Handle
-
such as sending some messages t o ther terminal - we'd like to have the
following properties:
- Properly handle character encoding settings on the
Handle
- For reasonably sized messages, ensure that the entire message is written in
one chunk to avoid interleaving data with other threads
- This includes the trailing newline character
- Avoid unnecessary memory allocations and copies
- Minimize locking
- Provide a simple API
On the last point: for the most part, you can make the following substitutions in your API usage:
- Replace
putStrLn
withsay
- Replace
print
withsayShow
- If you're using a
String
instead ofText
, replaceputStrLn
withsayString
In addition, sayErr
, sayErrString
and sayErrShow
work on
standard error instead, and hSay
, hSayString
and hSayShow
work
on arbitrary Handle
s.
#!/usr/bin/env stack
-- stack --install-ghc --resolver lts-6.23 runghc --package async --package say
import Control.Concurrent.Async (mapConcurrently)
import Control.Monad (forM_, void)
import Say (sayString)
worker :: Int -> IO ()
worker ident = forM_ [1..1000] $ \msg -> sayString $ concat
[ "Hello, I am worker #"
, show ident
, ", and this is message #"
, show msg
]
main :: IO ()
main = void $ mapConcurrently worker [1..100]