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
#r "packages/FSharp.Data.2.3.0-beta1/lib/net40/FSharp.Data.dll" | |
#r "System.Xml.Linq.dll" | |
open System | |
open System.Text | |
open FSharp.Data | |
[<Literal>] | |
let androidSample = """ | |
<smses count="40"> |
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 Html = | |
type HtmlNode = | |
| HtmlElement of name:string * attribute:HtmlAttribute list | |
| HtmlText of content:string *parent:HtmlNode | |
and HtmlAttribute = | |
| HtmlAttribute of name:string * value:string * parent:HtmlNode | |
let createElement name attrs = |
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
#r @"packages\FSharp.Data.2.0.0-alpha2\lib\net40\FSharp.Data.dll" | |
#r "System.Xml.Linq" | |
open System.Xml.Linq | |
open FSharp.Data | |
open FSharp.Data.Json | |
open FSharp.Data.Json.Extensions | |
open FSharp.Net | |
// Without Type Providers |
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
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><body><div class="page"><div class="header"><div class="hInner"><div class="hBar"><div id="div-gpt-ad-8507337232-0"></div></div><div class="title clr"><a href="/" class="logo"><img src="/img/nremed.png" alt="National Rail Enquiries" /></a></div></div></div><div class="header clr"><div class="header-panel clr"><h1>Live departure boards</h1><a class="rBtn" href="javascript:location.reload(true)"><img width="15" height="17" alt="Reload" src="/img/arrowcircle.gif" /></a></div></div><div class="pageCont"><table class="jDetails jDest"><tr><td class="label"><strong>22:44</strong></td><td colspan="2">London Bridge </td></tr><tr class="pb10"><td class="label">To:</td><td colspan="2">Orpington <small>Southeastern</small></td></tr></table><!-- <table class="jDetails jDest"><tr><td class="label"><strong>22:44< |
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
<?xml version="1.0" encoding="utf-8"?> | |
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | |
<id>@project@</id> | |
<version>@build.number@</version> | |
<authors>@authors@</authors> | |
<owners>@authors@</owners> | |
<licenseUrl>http://github.com/fsharp/FSharp.Data/blob/master/LICENSE.md</licenseUrl> | |
<projectUrl>http://fsharp.github.com/FSharp.Data</projectUrl> | |
<iconUrl>https://raw.github.com/fsharp/FSharp.Data/master/misc/logo.png</iconUrl> |
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
(new CsvFile<_>(new Func<_, _, _>(fun (parent : obj) (row : string []) -> Operations.GetNonOptionalValue("Name", Operations.ConvertString(Operations.AsOption(row.[0])), Operations.AsOption(row.[0])), Operations.GetNonOptionalValue("Distance", Operations.ConvertDecimal("", Operations.AsOption(row.[1])), Operations.AsOption(row.[1])), Operations.GetNonOptionalValue("Time", Operations.ConvertDecimal("", Operations.AsOption(row.[2])), Operations.AsOption(row.[2]))), | |
new Func<_, _>(fun (row : _ * _ * _) -> | |
[|Operations.ConvertStringBack(Operations.GetOptionalValue(let x, _, _ = row | |
x)) | |
Operations.ConvertDecimalBack(, , | |
Operations.GetOptionalValue(let _, x, _ = row | |
x)) | |
Operations.ConvertDecimalBack( O, | |
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
#r "bin/v40/FSharp.Data.dll" | |
open FSharp.Data.Csv | |
open FSharp.Data.Csv.Extensions | |
let map f (csvFile:CsvFile) = | |
let headers = csvFile.Headers |> f |> String.concat "," | |
let data = csvFile.Data |> Seq.map (fun row -> row.Columns |> f |> String.concat ",") |> String.concat "\n" | |
CsvFile.Parse(headers + "\n" + data) | |
let filter f (csvFile:CsvFile) = |
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
class WorldBankDataProvider | |
static member GetDataContext: () -> WorldBankDataProvider+ServiceTypes+WorldBankDataService | |
class WorldBankDataProvider+ServiceTypes | |
class WorldBankDataProvider+ServiceTypes+WorldBankDataService : FDR.WorldBank.WorldBankData | |
member Countries: WorldBankDataProvider+ServiceTypes+Countries with get | |
member Regions: WorldBankDataProvider+ServiceTypes+Regions with get | |
member Topics: WorldBankDataProvider+ServiceTypes+Topics with get |
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
#r "packages/FSharp.Data.1.1.10/lib/net40/FSharp.Data.dll" | |
open FSharp.Data.Csv | |
open FSharp.Data.Csv.Extensions | |
let csv = CsvFile.Load("http://faculty.washington.edu/heagerty/Books/Biostatistics/DATA/ozone.csv") | |
//What are the column names of the dataset? | |
csv.Headers |
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
//This script generates | |
//a file named __project.fsx, for each proejct which can be #load "__project.fsx" in script intending to use the same dependency graph as the code in VS | |
//a file named __solmerged.fsx, at the solution root which can be #load "__solmerged.fsx" in script intending to use the same dependency graph as the code in VS | |
//In both cases, this enforce that a script compiling in VS should work from within FSI | |
#if INTERACTIVE | |
#r "System.Xml" | |
#r "System.Xml.Linq" | |
#endif |
NewerOlder