{"id":22430837,"url":"https://github.com/clovyr/string-fromto","last_synced_at":"2025-06-10T16:10:12.771Z","repository":{"id":56879315,"uuid":"211914993","full_name":"clovyr/string-fromto","owner":"clovyr","description":"Conversions between common string types, as well as Base16/Base32/Base64","archived":false,"fork":false,"pushed_at":"2020-08-18T00:08:08.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T04:20:39.287Z","etag":null,"topics":["base16","base32","base64","bytestring","conversion","haskell","text"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/string-fromto","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clovyr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-30T17:23:28.000Z","updated_at":"2024-10-09T21:40:09.000Z","dependencies_parsed_at":"2022-08-20T11:40:44.002Z","dependency_job_id":null,"html_url":"https://github.com/clovyr/string-fromto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovyr%2Fstring-fromto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovyr%2Fstring-fromto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovyr%2Fstring-fromto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovyr%2Fstring-fromto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clovyr","download_url":"https://codeload.github.com/clovyr/string-fromto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovyr%2Fstring-fromto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259106662,"owners_count":22805940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["base16","base32","base64","bytestring","conversion","haskell","text"],"created_at":"2024-12-05T21:09:44.573Z","updated_at":"2025-06-10T16:10:12.733Z","avatar_url":"https://github.com/clovyr.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# string-fromto\n\nA collection of predictably-named functions (e.g. byteStringToString) that\nconvert between the common string types, as well as to and from Base16, Base32,\nand Base64.\n\n## Usage\n\n```haskell\nimport Data.String.FromTo -- or imported as part of your Prelude\n\nstr :: String\nstr = \"Hi, I'm a string\"\n\ntext :: Text\ntext = stringToText str\n\nencoded :: ByteString\nencoded = textToBase64ByteString text\n\ndecoded :: Either String Text\ndecoded = base64ByteStringToText encoded\n```\n\n## Documentation\n\n[Hackage](https://hackage.haskell.org/package/string-fromto)\n\n## License\n\n[BSD3](LICENSE)\n\n## Motivation\n\nHave you ever found yourself frustrated that you're spending 15-30% of your\ntime in Haskell converting between string types, remembering which module has\nthe `toStrict` function, importing Data.Text.Encoding and\nData.Text.Lazy.Encoding qualified, spending time thinking about how to do\nBase64 encoding, etc.? Or tried to use one of the (excellent) typeclass-based\nstring conversion libraries, only to find yourself adding awkward type\nsignatures to avoid type-inferencing ambiguities?\n\nThis library exports a collection of functions that follow a simple pattern:\n\n```haskell\nstringTypeAToStringTypeB :: a -\u003e b\n```\n\nFor example:\n\n```haskell\n\nstringToByteString :: String -\u003e ByteString\n\nstringToLazyByteString :: String -\u003e Lazy.ByteString\n\nbase64ByteStringToText :: ByteString -\u003e Either String Text\n```\n\nThis way, if you import this module unqualified, or as part of your Prelude,\nall you have to think about is which type you want to convert into which other\ntype.\n\n(Note that not *every* possible permutation has a function, just each one we've\never needed. If you need one that's not included, please submit a pull request\nto add it.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclovyr%2Fstring-fromto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclovyr%2Fstring-fromto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclovyr%2Fstring-fromto/lists"}