https://github.com/joom/chalk
Simple terminal string styling in Haskell.
https://github.com/joom/chalk
Last synced: 10 months ago
JSON representation
Simple terminal string styling in Haskell.
- Host: GitHub
- URL: https://github.com/joom/chalk
- Owner: joom
- License: mit
- Created: 2015-02-23T14:53:52.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-09-14T12:28:28.000Z (almost 10 years ago)
- Last Synced: 2025-05-01T03:36:17.720Z (about 1 year ago)
- Language: Haskell
- Size: 51.8 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chalk
Simple terminal string styling in Haskell, in the style of JavaScript's [sindresorhus/chalk](https://github.com/sindresorhus/chalk) and [sindresorhus/ansi-styles](https://github.com/sindresorhus/ansi-styles).
## Installation
```
cabal install chalk
```
## Usage

(Image borrowed from [sindresorhus/ansi-styles](https://github.com/sindresorhus/ansi-styles).) Use any of the styling functions above to get the effect you want.
Since these are functions, you can compose them as you like.
```haskell
import System.Console.Chalk
main = do
putStrLn $ green "This is going to be green."
putStrLn $ (underline . blue) "This is going to be blue and underlined."
```
The type of the styling functions is `(Monoid m, IsString m) => m -> m`, so you
can use any type that has an instance of Monoid and IsString, which probably covers
what you will use this for.
## License
MIT