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
#if INTERACTIVE | |
#else | |
namespace Examples | |
#endif | |
(* | |
[<Sealed>] | |
type Future<'T> | |
module Future = |
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
type Proc<'T> = | |
| P of ('T -> option<Proc<'T>>) | |
exception Bleep | |
let def f = | |
P (fun x -> try Some (f x) with Bleep | MatchFailureException _ -> None) | |
let rec ( <||> ) (P a) (P b) = | |
let f x = |
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
Inductive choice a b := | |
| C1 : a -> choice a b | |
| C2 : b -> choice a b. | |
Notation " a ++ b " := (choice a b). | |
Module Type TRAIT. | |
Parameter t : Type -> Type. | |
Parameter and : forall {a b}, t a -> t b -> t (a * b). | |
Parameter or : forall {a b}, t a -> t b -> t (a ++ b). |
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
type Person = | |
{ | |
Address : string | |
Age : int | |
Name : string | |
} | |
let makePerson name age address = | |
{ | |
Address = address |
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
module GenericsExperiment | |
/// Generic property interface. Since F# lacks higher kinds, | |
/// we cannot write code parametric in `P`, so instead write code with casts | |
/// in terms of an open type `P<'T>`. | |
type P<'T> = | |
interface | |
end | |
/// Implements derivation rules for a certain generic property. |
This file has been truncated, but you can view the full file.
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
Mono log profiler data | |
Profiler version: 0.4 | |
Data version: 4 | |
Mean timer overhead: 5844 nanoseconds | |
Program startup: Tue Apr 2 17:00:45 2013 | |
Program ID: 3508 | |
Server listening on: 55256 | |
JIT summary |
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
// Example 1: `any` allows unsafe casts | |
var x : any = 1; | |
x(); | |
// Example 2: subtyping on functions allows unsafe casts | |
interface I1 { x: number; } | |
interface I2 { x: number; y: number; } | |
function f(g: (x: I1) => void) { g({x: 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
Require Import String. | |
Definition Parser (a : Type) := | |
string -> option (a * string). | |
Definition Return {a} (x: a) : Parser a := | |
fun s => Some (x, s). | |
Definition Bind {a b} (x: Parser a) (f: a -> Parser b) : Parser b := | |
fun s => |
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
# Maintainer: Joris Putcuyps <Joris.Putcuyps at gmail dot com> | |
pkgname=fsharp-git | |
pkgver=20130323 | |
pkgrel=1 | |
pkgdesc="An ML based functional language integrated with the .NET platform." | |
arch=('any') | |
url="http://msdn.microsoft.com/en-us/fsharp" | |
license=('APACHE') | |
groups=() | |
depends=('mono>=2.10.2') |
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
// Capture: http://docs.phonegap.com/en/2.5.0/cordova_media_capture_capture.md.html | |
module Capture { | |
interface ConfigurationData { | |
type: string; | |
height: number; | |
width: number; | |
} |