0
comment
on 12/2/2014 8:37 AM

A lot of useful functions of FSharp.Core are now translatable by WebSharper.

Async cancellation

  • Proxies for CancellationTokenSource, CancellationToken, CancellationTokenRegistration.
  • Proxies for Async class members: DefaultCancellationToken, CancelDefaultToken, CancellationToken, OnCancel, TryCancelled
  • Async RPC calls are cancellable, the cancel continuation runs ASAP and the response are discarded.

MailboxProcessor

  • Proxy handles timeout arguments and cancellation
  • PostAndReply/TryPostAndReply methods are not supported as JS is single-threaded.

Printf

  • Proxies for sprintf, printfn, failwithf, Printf.kbprintf
  • %O uses JavaScript String(x) function
  • %A generates a recursive pretty-printer for F# types if type information is available. Currently supports lists, unions, tuples, records, 1 and 2 dimensional arrays. Other types are sent to a dynamic pretty-printer.
  • printfn prints to JavaScript console
  • Printf.sprintf is not supported, use ExtraTopLevelOperators.sprintf instead.
  • Printing as unsigned is not supported.

Fixes

  • Fix #300: Server-side runtime error in some regional settings (for example Turkish)
  • Fix #304: Converting string to char checks string length now
  • Async.FromContinuations ensures that continuation is called only once, throws an error otherwise.

Breaking changes

  • System.Web.HttpPostedFile type in Sitelets API have been changed to System.Web.HttpPostedFileBase to enable non-ASP.NET hosting (OWIN).
  • Indexed properties in WIG: Previously if a property was defined with name "item", it translated to a an indexer on the object. This is changed so that the empty string is usable for this (still will get .NET property name Item, the default indexer for the class).
1
2
// generates default .NET indexer
"" =@ T<obj> |> Indexed T<int> // has JavaScript inline "$this[$index]"
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper