Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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.
- module Data.Types.Injective
- module Data.Types.Isomorphic
- as :: forall a b. (Iso a b, Iso b a) => (a -> a) -> b -> b
- as2 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a) -> b -> b -> b
- as3 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a -> a) -> b -> b -> b -> b
- as4 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a -> a -> a) -> b -> b -> b -> b -> b
Documentation
module Data.Types.Injective
module Data.Types.Isomorphic
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
as4 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a -> a -> a) -> b -> b -> b -> b -> b Source #
Like liftA4