https://github.com/cacilhas/pipelines
Function Pipelines support for SML
https://github.com/cacilhas/pipelines
pipeline smackage sml standard-ml
Last synced: 7 months ago
JSON representation
Function Pipelines support for SML
- Host: GitHub
- URL: https://github.com/cacilhas/pipelines
- Owner: cacilhas
- Created: 2019-01-07T19:22:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-25T01:13:46.000Z (over 6 years ago)
- Last Synced: 2025-01-21T15:49:46.500Z (9 months ago)
- Topics: pipeline, smackage, sml, standard-ml
- Language: Standard ML
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[elm-pipeline]: https://package.elm-lang.org/packages/elm-lang/core/latest/Basics#(|%3E)
[haskel-pipeline]: https://wiki.haskell.org/$
[license]: https://opensource.org/licenses/BSD-3-Clause
[mlton]: http://mlton.org/
[smackage]: http://www.elsman.com/lessons/2014/10/02/getting-started-with-smackage
[unittestml]: https://github.com/cacilhas/UnitTestML# Function Pipelines support
This lib provides function pipelines like you can find
in [Elm][elm-pipeline] and [Haskel][haskel-pipeline].Depends on [MLton][mlton].
## Installing
Install [Smackage][smackage] and run:
```sh
smackage source pipelines git https://github.com/cacilhas/pipelines
smackage refresh
smackage get pipelines
```## Usage
In your MLBasis add the entry:
```sml
$(SMACKAGE)/pipelines/v1/pipelines.mlb
```## Examples
### `|>` example
Instead of:
```sml
a (b c (d e))
```You can use:
```sml
d e |> b c |> a
```### `$` example
Instead of:
```sml
a (b c (d e))
```You can write:
```sml
a $ b c $ d e
```### `!!` example
Intead of:
```sml
List.nth ([1, 2, 4, 8, 16], 2)
```Uou can use:
```sml
[1, 2, 4, 8, 16] !! 2
```## Testing
Install [UnitTestML][unittestml] and run:
```sh
mlton tests/test.mlb
./tests/test
```## License
[The 3-Clause BSD License][license]
```
Copyright 2018 Rodrigo CacilhasRedistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```