Functional programming extensions for cross-platform Swift




Functional programming extensions for cross-platform Swift, heavily inspired by underscore.js.

Build Status Language Platforms SPM compatible License codecov codebeat

What is Underscore

The goal of the project is to provide functional extensions for pure open source Swift (Seriously, no Core Foundation, UIKit etc.). It can support all platforms Swift can support e.g. MacOS, iOS, watchOS, tvOS, Linux, and maybe Android and Raspberry Pi.

The project is under development, because the open source Swift version 2.2 lacks some important features like swift test. And swift build is gone from the release package after 2016-01-11 release (that's why we are using swift-2.2-SNAPSHOT-2016-01-11-a-ubuntu14.04.tar.gz currently). Unfortunately, Swift 3.0 is unstable as well, the complier crashes when we use swift build to build the project.

We have a clear goal and specific approaches to achieve the goal. If you are interested in contributing to cross-platform open source Swift project, please contact @JakeLin or @satyaavasarala. Let's have some fun with open source Swift 😘.

How to build

Clone the repository

git clone
cd Underscore

Using Xcode 7.3 with Swift 2.2

open Xcode/Underscore.xcodeproj

Once Xcode is open, press Command + d to run the tests. You also change the tragets to run the tests in different platforms.

Using Linux

We use a Linux virtual machine on MacOS to develop the project on Linux.

Installing VirtualBox

Go to Download VirtualBox to download the latest version of VirtualBox and install it.

Installing Vagrant

Go to Download Vagrant to download the latest version of Vagrant and install it.

Start the VM when the installation finishes

# On MacOS
vagrant up 

Once the VM is up, ssh to the VM

# On MacOS
vagrant ssh

After log in to the Linux machine, install Swift 2.2 (The current supported version for the project)

# On Linux
cd /vagrant

Exit and re-ssh again then run swift build to build the project

# On MacOS
vagrant ssh
# On Linux
cd /vagrant
swift build