An open API service indexing awesome lists of open source software.

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

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
```