string-isos-0.1.0.1: Tools for working with isomorphisms of strings

Safe HaskellSafe
LanguageHaskell2010

Text.Isomorphic

Contents

Description

Assuming UTF8 encoding the following types are isomorphic

  • Data.ByteString.Lazy.ByteString
  • Data.ByteString.ByteString
  • Data.Text.Lazy.Text
  • Data.Text.Text
  • String

Yet working with them and converting is a pain!

This package exposes this 5 way isomorphism to make conversion easy.

Synopsis

Documentation

as :: forall a b. (Iso a b, Iso b a) => (a -> a) -> b -> b Source #

This is useful for any iso, but in the case of string like stuff. You can now work with a function from one string type, while not having to do any conversion.

  f :: ByteString -> ByteString
  a :: Text
  as f a :: Text

as2 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a) -> b -> b -> b Source #

Like liftA2

as3 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a -> a) -> b -> b -> b -> b Source #

Like liftA3

as4 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a -> a -> a) -> b -> b -> b -> b -> b Source #

Like liftA4

Orphan instances

Iso String ByteString Source # 
Iso String ByteString Source # 
Iso ByteString String Source # 
Iso ByteString ByteString Source # 
Iso ByteString Text Source # 
Iso ByteString Text Source # 
Iso ByteString String Source # 
Iso ByteString ByteString Source # 
Iso ByteString Text Source # 
Iso ByteString Text Source # 
Iso Text ByteString Source # 
Iso Text ByteString Source # 
Iso Text ByteString Source # 
Iso Text ByteString Source # 
IsString s => Injective String s Source # 

Methods

to :: String -> s #

Injective String ByteString Source # 

Methods

to :: String -> ByteString #

Injective String ByteString Source # 

Methods

to :: String -> ByteString #

Injective ByteString String Source # 

Methods

to :: ByteString -> String #

Injective ByteString ByteString Source # 

Methods

to :: ByteString -> ByteString #

Injective ByteString Text Source # 

Methods

to :: ByteString -> Text #

Injective ByteString Text Source # 

Methods

to :: ByteString -> Text #

Injective ByteString String Source # 

Methods

to :: ByteString -> String #

Injective ByteString ByteString Source # 

Methods

to :: ByteString -> ByteString #

Injective ByteString Text Source # 

Methods

to :: ByteString -> Text #

Injective ByteString Text Source # 

Methods

to :: ByteString -> Text #

Injective Text ByteString Source # 

Methods

to :: Text -> ByteString #

Injective Text ByteString Source # 

Methods

to :: Text -> ByteString #

Injective Text ByteString Source # 

Methods

to :: Text -> ByteString #

Injective Text ByteString Source # 

Methods

to :: Text -> ByteString #