Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type class for lazy and strict text types #18

Closed
chshersh opened this issue Jul 19, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@chshersh
Copy link
Member

commented Jul 19, 2018

class LazyStrict l s | l -> s, s -> l where
  toLazy :: s -> l
  toStrict :: l -> s

fromLazy :: LazyStrict l s => l -> s
fromLazy = toStrict

fromStrict :: LazyStrict l s => s -> l
fromStrict = toLazy

instance LazyStrict L.ByteString S.ByteString
instance LazyStrict L.Text S.Text

@chshersh chshersh added the new label Jul 19, 2018

@chshersh chshersh added this to the 0.1.0: ANN milestone Jul 19, 2018

vrom911 added a commit that referenced this issue Jul 20, 2018

@chshersh chshersh closed this in #33 Jul 20, 2018

chshersh added a commit that referenced this issue Jul 20, 2018

[#18] Add LazyStrict type class (#33)
* [#18] Add LazyStrict type class

* Remove map = fmap, reexport from Data.List
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.