https://github.com/selectel/stringlike
Transformations to several string-like types
https://github.com/selectel/stringlike
community haskell
Last synced: 7 months ago
JSON representation
Transformations to several string-like types
- Host: GitHub
- URL: https://github.com/selectel/stringlike
- Owner: selectel
- License: mit
- Created: 2013-03-21T09:35:54.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-07-20T13:12:03.000Z (almost 13 years ago)
- Last Synced: 2024-04-29T20:21:20.559Z (about 2 years ago)
- Topics: community, haskell
- Language: Haskell
- Homepage:
- Size: 137 KB
- Stars: 0
- Watchers: 20
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
stringlike [![Build Status][travis-img]][travis]
==========
Transformations to several string-like types.
[travis]: http://travis-ci.org/selectel/stringlike
[travis-img]: https://secure.travis-ci.org/selectel/stringlike.png
Example
-------
```haskell
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString.Lazy
data Foo = Bar | Baz
instance ToString Foo where
toText Bar = "bar"
toText Baz = "baz"
test :: ByteString -> ()
test = const ()
main :: IO ()
main = do
test $ string Bar
test $ lbs Baz
```