Before talking about monads, we should review 3 concepts:
They appear in the form f :: a -> b, where :: indicates the type of f.
| use std::str; | |
| fn main() { | |
| // -- FROM: vec of chars -- | |
| let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
| // to String | |
| let string1: String = src1.iter().collect::<String>(); | |
| // to str | |
| let str1: &str = &src1.iter().collect::<String>(); | |
| // to vec of byte |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x| Here's how to make jQuery DataTables work with npm and webpack. DT checks for AMD compatibility first | |
| which breaks when you're using CommonJS with webpack. | |
| Install DT core: npm install datatables.net | |
| Install a DT style: npm install datatables.net-bs (bootstrap) | |
| Install the imports-loader webpack plugin: https://github.com/webpack/imports-loader#disable-amd | |
| Create a loader "exception" just for DT in webpack.config.js: | |
| module: { | |
| loaders: [ |
| var request = require('supertest'), | |
| should = require('should'), | |
| app = require('../server'); | |
| var Cookies; | |
| describe('Functional Test <Sessions>:', function () { | |
| it('should create user session for valid user', function (done) { | |
| request(app) | |
| .post('/v1/sessions') |
| # Never save database creditentials in your repo. Keep a dummy copy with a different name eg "local.xml.dev" | |
| app/etc/local.xml | |
| downloader | |
| # If you'd like to keep the downloader, use the following instead: | |
| # downloader/.cache | |
| # downloader/cache.cfg | |
| # downloader/connect.cfg | |
| # All of the var folders can be excluded. |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"