Visitar URL original
GitHub - thoradam/unison-read: A library for Unison (https://www.unisonweb.org) that provides a Read ability, along with some combinators and handlers, that allow for incrementally consuming some values to produce a result or fail
The Wayback Machine - https://web.archive.org/web/20230131222938/https://github.com/thoradam/unison-read
Skip to content

A library for Unison (https://www.unisonweb.org) that provides a Read ability, along with some combinators and handlers, that allow for incrementally consuming some values to produce a result or fail

thoradam/unison-read

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

unison-read

Provides a Read a ability, along with some combinators and handlers, that allows for incrementally consuming some as to produce a result or fail.

Example

csv : '{Read Char} [[Text]]
csv = 'let
  cell = '(fromCharList (any '(none [?\n, ?,])))
  cells = '(!cell +: or more '[])
  more = '('(one ?,) *> cells)
  lines = '(!cells +: or moreLines '[])
  moreLines = '('(one ?\n) *> lines)
  !lines

> readText csv "123,123,123\n12,12\n1"
    ⧩
    ReadResult
    (3, 1)
    (Right
        [ ["123", "123", "123"],
        ["12", "12"],
        ["1"] ])

Install

.> pull https://github.com/thoradam/unison-read:.releases._v1 .external.read.v1

About

A library for Unison (https://www.unisonweb.org) that provides a Read ability, along with some combinators and handlers, that allow for incrementally consuming some values to produce a result or fail

Topics

Resources

Stars

Watchers

Forks