a / b * b + (a
mod b) = a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypeConstructor Main.Person | |
Error: | |
Error in module Main: | |
Error in value declaration name: | |
Error checking that type | |
Main.Person | |
subsumes type | |
Prim.Int -> Main.Person | |
Error at /home/michael/dev/contrib/purescript/examples/failing/CaseDoesNotMatchAllConstructorArgs.purs line 12, column 17 - line 12, column 34: | |
Cannot unify type |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
Example failing with multiple counters:
List comprehensions
[i for i in xrange(1, 20) if i % 3 == 0]
Dot
foo.bar()
In Object Oriented programming, send the message "bar" to foo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deepProperty = function (properties) { | |
return function (obj) { | |
return properties.reduce(function (obj, key) { | |
return obj[key]; | |
}, obj); | |
}; | |
}; | |
deepProp(['a', 'b', 'c'])({ a: { b: { c: 42 } }}) // => 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const buildMatcher = (cases) => (actual) => | |
cases | |
.find((cse) => cse.matches(actual)) | |
.result(actual); | |
const buildNextOn = (previousCases) => { | |
var build = (matchesPred, result) => { | |
const cases = previousCases.concat( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple file IO | |
```python | |
with open('somefile.txt', 'w') as file: | |
file.write('foobar') | |
with open('somefile.txt', 'r') as file: | |
text = file.read() | |
print text | |
# => foobar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compose() { | |
return Array | |
.prototype | |
.slice | |
.call(arguments) | |
.reduce(compose2, identity); | |
} | |
function compose2(f, g) { | |
return function (x) { |
OlderNewer