~evanj/ego

018637ae4ca77deb73f3d9bcf27399c91fdb097f — Evan M Jones 1 year, 1 month ago 3eee674
Feat(README): Add proper readme and remove old.
2 files changed, 60 insertions(+), 44 deletions(-)

D README.md
A README.txt
D README.md => README.md +0 -44
@@ 1,44 0,0 @@
# The Go Programming Language

Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software.

![Gopher image](doc/gopher/fiveyears.jpg)
*Gopher image by [Renee French][rf], licensed under [Creative Commons 3.0 Attributions license][cc3-by].*

Our canonical Git repository is located at https://go.googlesource.com/go.
There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the
BSD-style license found in the LICENSE file.

### Download and Install

#### Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install
or load [doc/install.html](./doc/install.html) in your web browser for installation
instructions.

#### Install From Source

If a binary distribution is not available for your combination of
operating system and architecture, visit
https://golang.org/doc/install/source or load [doc/install-source.html](./doc/install-source.html)
in your web browser for source installation instructions.

### Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines:
	https://golang.org/doc/contribute.html

Note that the Go project uses the issue tracker for bug reports and
proposals only. See https://golang.org/wiki/Questions for a list of
places to ask questions about the Go language.

[rf]: https://reneefrench.blogspot.com/
[cc3-by]: https://creativecommons.org/licenses/by/3.0/

A README.txt => README.txt +60 -0
@@ 0,0 1,60 @@
ABOUT: 

Ego stand for Evan's Go. My name is Evan. Hello! Ego is a (tiny) collection of
exploritory Go extensions. Current additions include:

1. Maybe type.
2. builtin `ok` function.
3. builtin `err` function.
4. `pair` statement.

All current additions are centered around an "either" monad. For those familiar
with Rust's `Result` type the following should be familiar. Here's a minimal 
example:

| package main
| 
| import (
| 	"errors"
| 	"fmt"
| )
| 
| func fact(top int) maybe int {
| 	if top < 0 {
| 		return err(errors.New("must be greated than one"))
| 	}
| 
| 	if top == 0 {
| 		return ok(1)
| 	}
| 
| 	pair fact(top - 1) {
| 		(val int) {
| 			val = val * top
| 			if val == 0 {
| 				return err(errors.New("overflow"))
| 			}
| 			return ok(val)
| 		}
| 		(e error) {
| 			return err(e) // Isn't actually reached in this example.
| 		}
| 	}
| }
| 
| func main () {
| 	pair fact(5) {
| 		(val int) {
| 			fmt.Printf("value: %d\n", val)
| 		}
| 		(e error) {
| 			fmt.Println(e.Error())
| 		}
| 	}
| }

BUILDING: 

Clone repository. `cd` into `src` directory. Run `./make.bash` and binaries will
be ouput to the `bin` directory. If you intend to use Ego it's helpful to add
the `bin` directory to your path.