Skip to content

Commit

Permalink
Added logo, updated project desc & README.
Browse files Browse the repository at this point in the history
  • Loading branch information
oubiwann committed Dec 16, 2020
1 parent 2c9877a commit cdd22e7
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 24 deletions.
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
The MIT License (MIT)

Copyright (c) 2016 Xavier Van de Woestyne

Copyright (c) 2020 Duncan McGreggor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
61 changes: 38 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
![](https://travis-ci.org/derniercri/coers.svg?branch=master)
# coers

coers
=====
[![Project Logo][logo]][logo-large]

*A small library for coercion to primitive Erlang types*

## About

Coers is a very small library to provide small coercion
on primitive types in Erlang. This library was built
essentially for internal tools at derniercri.io

Build & test
-----
## Build & Test

$ # Compile the library
$ rebar3 compile
$ # run the tests using eUnit
$ rebar3 eunit


Usage
--------

You can run an erlang shell with `coers` completely loaded : `rebar3 shell` :

```shell
===> Verifying dependencies...
===> Compiling coers
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]

Eshell V8.1 (abort with ^G)
```

### Basics
## Usage

Each coercion is wrapped into a special record:

Expand Down Expand Up @@ -62,9 +51,35 @@ For example :
[10,0]
```

Documentation
--------
Example usgage in LFE:

``` lisp
(defun ->lfe (arg)
(case arg
(#"#t" 'true)
(#"#f" 'false)
(#"NIL" 'nil)
(_ (cond ((?= `#(result true ,val) (coers:to_int arg))
val)
((?= `#(result true ,val) (coers:to_float arg))
val)
((?= `#(result true ,val) (coers:to_bool arg))
val)
((?= `#(result true ,val) (coers:to_string arg))
val)
('true arg)))))
```

## License

MIT

Copyright © 2016, Xavier van De Woestyne

Copyright © 2020, Duncan McGreggor <[email protected]>.

This page exposes the feature list : <http://xvw.github.io/coers/coers.html>

[//]: ---Named-Links---

[logo]: priv/images/logo-v1.png
[logo-large]: priv/images/logo-v1.svg
Binary file added priv/images/logo-v1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cdd22e7

Please sign in to comment.