This file contains hidden or 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 demo | |
object ScalaDsl { | |
/* | |
* Defining a simplistic model for the web app DSL | |
*/ | |
case class HttpRequest(path: String, headers: Map[String, String], body: Option[String]) |
This file contains hidden or 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
type VersionNumber = | |
| Major of major: int | |
| Minor of major: int * minor: int | |
| Patch of major: int * minor: int * patch: int | |
type Version = | |
| Release of VersionNumber | |
| PreRelease of VersionNumber * string | |
static member create (x) = Release (Major x) |
This file contains hidden or 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
import akka.actor._ | |
import akka.pattern.ask | |
import scala.concurrent.duration._ | |
import scala.concurrent.Future | |
import scala.concurrent.Promise | |
import scala.concurrent.ExecutionContext | |
class AskingActor(val service: ActorRef) extends Actor { | |
case class SomeCommand(id: String) | |
case class SomeEvent(id: String) |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using FSharpx; | |
using Microsoft.FSharp.Core; | |
using NUnit.Framework; | |
namespace FunctionalErrorHandling | |
{ | |
public static class Extensions |
This file contains hidden or 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 kataTennis | |
sealed trait Player | |
case object Player1 extends Player | |
case object Player2 extends Player | |
sealed trait Score { | |
def inc: Score = this match { | |
case Score0 => Score15 | |
case Score15 => Score30 |
This file contains hidden or 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
[ | |
{ | |
"title": "Far future", | |
"startsAt": "2013-01-01 00:00:00Z", | |
"accept": "http://...", | |
"decline": "http://..." | |
},{ | |
"title": "Near future", | |
"startsAt": "2012-09-01 00:00:00Z", | |
"rsvp_status": "accepted", |
This file contains hidden or 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
{ | |
"order": { | |
"href": "http://...", | |
"method": "POST", | |
"template": { | |
"location": "", | |
"@location": { | |
"prompt": "Enter your postal code" | |
}, | |
"pickupTime": "", |
This file contains hidden or 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
{ | |
"@": { | |
"id": "http://example.org/my-obj", | |
"description": "This object is described with an embedded descriptor. Other JSON-Schema properties may follow." | |
}, | |
"prop": "value" | |
} |
This file contains hidden or 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(){ | |
$('<pre id="results"></pre>').appendTo('body'); | |
window.log = function(msg) { | |
if (typeof msg !== 'string') { | |
msg = JSON.stringify(msg, null, 2); | |
} | |
$('#results').append(msg + '\n'); | |
}; | |
}); |
This file contains hidden or 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
namespace FunctionalCSharp | |
{ | |
using System; | |
using Shouldly; | |
using Xunit; | |
public class Tests | |
{ |