Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[TODO] obfusk.coffee - functional programming library for js/coffee

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md
File        : README.md
Maintainer  : Felix C. Stegerman <flx@obfusk.net>
Date        : 2013-08-16

Copyright   : Copyright (C) 2013  Felix C. Stegerman
Version     : v0.0.2-SNAPSHOT

Description

obfusk.coffee - functional programming library for js/coffee

...

Examples

See http://obfusk.github.io/obfusk.coffee for the annotated source with examples.

O = require 'obfusk'

O.match O.Just(42),
  Nothing: -> console.log 'Nothing to see here ...'
  Just: (x) -> console.log "The answer is: #{x.value}"
# => (console) The answer is 42

neg = O.multi((x) -> 'default')
  .method ((x) -> typeof x == 'number'),
          ((x) -> -x)
  .method ((x) -> typeof x == 'boolean'),
          ((x) -> !x)
neg 42      # => -42
neg false   # => true
neg 'foo'   # => 'default'

Install

$ git clone https://github.com/obfusk/obfusk.coffee.git
$ cd obfusk.coffee
$ npm [-g] install

Specs & Docs

$ rake spec
$ rake docs

TODO

  • build!
  • examples!
  • npm!
  • more specs/docs?
  • ...

License

GPLv2 [1] or EPLv1 [2].

References

[1] GNU General Public License, version 2 --- http://www.opensource.org/licenses/GPL-2.0

[2] Eclipse Public License, version 1 --- http://www.opensource.org/licenses/EPL-1.0

Something went wrong with that request. Please try again.