F# Weekly #48, 2012

Welcome to F# Weekly,

F# shines like a diamond in the daily coding routine. Piece of that shine from this past week:


  • Zach Bray announced FunScript. (F# to JavaScript compiler with JQuery etc. mappings through a TypeScript type provider)
  • The Nuget team fixed the F# compatibility bugs. You can use the nightly build.
  • F# works with MonoDroid.(more details)
  • Voting began for better F# support in NuGet.

Blogs & Tutorials

Upcoming events

That’s all for now.  Have a great week and remember you can message me on twitter (@sergey_tihon) with any F# news.

Previous F# Weekly edition – #47

SharePoint 2013 Development Environment

Talbott Crowell's Software Development Blog

In this post, I’m going to describe my setup and some of the software and system requirements I needed for getting a SharePoint 2013 development environment up and running.  I’ll try to update this post as new releases of the Microsoft Office Developer Tools for Visual Studio 2012 are released or I make major changes or discoveries as time progresses.


Development Environment Setup

I’ve been using CloudShare for some of my SharePoint 2013 development ever since I purchased my new MacBook Air 11 inch which is maxed out at 8 GB and running Parallels so I can run Windows 7.  But recently I’ve decided to pull out my old Dell Precision M6500 laptop which has 16 GB to get a SharePoint 2013 development environment set up locally.  This beast is a great laptop for SharePoint development, but it is very heavy (the power supply is heavier then my MacBook Air). …

View original post 1,930 more words

F# Weekly #47, 2012

Welcome to F# Weekly,

A roundup of F# content from this past week:

Blogs & Tutorials

Resources & Books

Upcoming events

That’s all for now.  Have a great week and remember you can message me on twitter (@sergey_tihon) with any F# news.

Previous F# Weekly edition – #46

F# Weekly #46, 2012

Welcome to F# Weekly,

It’s time to read Mission Statement and join F# Software Foundation! Now you can enjoy new portion of F# weekly:

Blogs & Tutorials

Resources & Books

That’s all for now.  Have a great week and remember you can message me on twitter (@sergey_tihon) with any F# news.

Previous F# Weekly edition – #45

Accessing Local Variable Information in FSI

It’s time to make first steps to the new improved FSI. I feel that I should start looking for ways to implement something from My wish list for FSI. Let’s begin from #3 and try to find a list of declared variables and functions.

Before execution of any piece of code, FSI compiles it and creates a new type in current assembly. This type contain all named variables as properties and named function as function. The latest unnamed variable/function stores in property that called ‘it‘. So, it means that we can collect all required information using reflection.

Below you can find my implementation of the function objects() that prints lists of declared variables and functions.

let objects() =
  let methods =
      |> Seq.filter (fun t ->
        t.CustomAttributes |> Seq.exists (fun a ->
          a.AttributeType = typeof<Microsoft.FSharp.Core.CompilationMappingAttribute>))
      |> Seq.sortBy (fun t -> t.Name)
      |> Seq.map (fun t ->
        t.GetMethods() |> Seq.filter(fun m -> not(m.IsHideBySig)))
      |> Seq.concat
      |> List.ofSeq
  let var, func =
    Map.empty<string, System.Reflection.MethodInfo>
      |> List.foldBack (fun (m:System.Reflection.MethodInfo) map ->
              let name = if (not(m.IsSpecialName)) then m.Name
                         else m.Name.Substring(4)
              if ((m.IsSpecialName && (m.GetParameters().Length > 0)) ||
                  map.ContainsKey(name)) then map
              else map.Add(name, m))
      |> Map.toList
      |> List.partition (fun (_,m) -> m.IsSpecialName)

  let printList title ls =
    printfn "%s : %A" title ( ls |> List.map fst |> List.sort )
  var  |> printList "Variables"
  func |> printList "Functions"

Now let’s look at a real-life example on the screenshot below.

My wish list for FSI

I have thought about possible directions of FSI development. I have some ideas that I would like to share and discuss.

In general, it would be great to make FSI more than just an execution shell. It can become a really powerful development tool. What exactly we can do:

1) Session Save/Load functionality

It will be nice to have an ability to save current FSI state into the file and continue work in the next time.

2) Native C# interaction with FSI saved sessions

It could sound crazy, but  it would be cool to save FSI session to assembly and provide an easy C#-F# interaction with such assemblies.  For example, it might be useful for Machine Learning tasks. You will be able to create, train and tune your model directly from FSI then save it to assembly and use it from your C# application.

3) Current environment overview

Provide an ability to see the difference between current FSI state and default state. For example:

  1. Print all declared variables with their values
  2. Print all declared function with their signatures
  3. Print list of referenced assemblies with included directories
  4. Provide an ability to print function’s body

There is a tool that provides a part of this functionality. This is FsEye – a visual object tree inspector for the F# Interactive.

4) Intellisense for FSI
5) Detailed type provider description

One of the main cons in type providers is impossibility to explore the schema of the provided world. For example, I want to use Freebase type provider, but I do not know the nature of the provided types. I cannot use provided types fully, because I do not know what data they have.

I am pretty much sure that we need to supply a way to explore provided types. This feature for sure should be tightly integrated with F# IDEs (into Object browser for example).

6)Interactive help

All we use MSDN to understand how things work. We copy type name + function name and paste them to Google, find first MSDN link and go there. Why cannot we teach FSI to do it? We just need to build an easy syntax for that.

7) The ability to use the load directive inside of modules\functions (by @davidkl_)

P.S. I will be happy to hear your feedback or new ideas. Feel free to post comments here or to contact me in twitter (@sergey_tihon).

F# Weekly #45, 2012

Welcome to F# Weekly,

Enjoy F# reading list from this past week.

Blogs & Tutorials

Resources & Books

Upcoming events

That’s all for now.  Have a great week and remember you can message me on twitter (@sergey_tihon) with any F# news or use hashtag #fsharpweekly.


Previous edition of the F# Weekly – #44

Seven SharePoint Videos from //build/ 2012 Conference

Personalized Search on the Largest Flash Sale Site in America

Today  posted a presentation about the example of using Solr in the sale site.

“This talk provides a tour of how Apache Solr is used to power search for America’s largest flash sale site, http://www.gilt.com. We show how to address the challenges of providing listings for fast moving inventory in a search space personalized for each of our members. The solution, built on Play Framework comprises less than 4,000 lines of code, and provides response times of 40ms on average.”