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
let isEven :: Number -> Boolean | |
let isEven 0 = false | |
let isEven 1 = false | |
let isEven 2 = true | |
let isEven n = isEven(n-1) |
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
{ | |
"name": "playground", | |
"description": "An empty PureScript project.", | |
"keywords": [ | |
"purescript" | |
], | |
"ignore": [ | |
"**/.*", | |
"bower_components", | |
"node_modules", |
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
dotPsci: ["src/**/*.purs", "bower_components/**/src/**/*.purs"] | |
// grunt verbose output | |
/* | |
Running "dotPsci" task | |
Running "dotPsci:0" (dotPsci) task | |
Verifying property dotPsci.0 exists in config...OK | |
Files: src/Chapter2/Chapter2.purs -> 0 | |
Reading .psci...OK |
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
package tutorial.webapp | |
import scala.scalajs.js.JSApp | |
object TutorialApp extends JSApp { | |
def main(): Unit = { | |
println("Hello world!") | |
} | |
} |
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
case class Car(Brand:String) | |
val tuple = ("this","is","a","tuple", 19, Car("Ford")) | |
// iterating over all items | |
tuple.productIterator.foreach(println) | |
/* | |
this | |
is | |
a | |
tuple |
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
// Global jasmine hook to prevent errors when attempt to | |
// download a localization .json file in test environment. | |
// Here we are resetting the translate provider to a | |
// safe state. | |
// If a test needs to assert for localized texts, | |
// the test author is free to setup the translate provider | |
// on isolation by overriding its settings. | |
// This wont affect other tests because once the test execution | |
// exits, the translate provider is reset once again to | |
// a safe state. |
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
app.directive 'enterKey', ($timeout) -> | |
(scope, elem, attrs) -> | |
elem.bind 'keydown', (e) -> | |
if e.keyCode is 13 | |
$timeout -> | |
scope.$apply attrs.enterKey | |
, +attrs.enterKeyDelay |
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
object HelloFuturesScala extends App { | |
import scala.concurrent._ | |
import scala.concurrent.duration._ | |
import ExecutionContext.Implicits.global | |
def identityFunction(number:Int) = { | |
Thread.sleep(3000) | |
number | |
} | |
println("Hello Futures Scala") |
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
Gtk-Message: Failed to load module "overlay-scrollbar" | |
`menu_proxy_module_load': skype-bin: undefined symbol: menu_proxy_module_load | |
(skype-bin:18177): Gtk-WARNING **: Failed to load type module: (null) | |
`menu_proxy_module_load': skype-bin: undefined symbol: menu_proxy_module_load | |
(skype-bin:18177): Gtk-WARNING **: Failed to load type module: (null) | |
`menu_proxy_module_load': skype-bin: undefined symbol: menu_proxy_module_load |
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
Your overall score for this assignment is 9.58 out of 10.00 | |
The code you submitted did not pass all of our tests: your submission achieved a score of | |
7.58 out of 8.00 in our tests. | |
In order to find bugs in your code, we advise to perform the following steps: | |
- Take a close look at the test output that you can find below: it should point you to | |
the part of your code that has bugs. | |
- Run the tests that we provide with the handout on your code. | |
- The tests we provide do not test your code in depth: they are very incomplete. In order |