F# Weekly #3, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations/Courses

Blogs

F# vNext News

New releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #2Subscribe

F# Weekly #2, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations/Courses

Blogs

F# vNext News

New releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #1Subscribe

FAKE Final Targets

Today I discovered a new (for me) FAKE feature called FinalTarget. I worked on integration with our new product ReportPortal (in beta right now) that collects and visualizes test results and faced a problem …

The integration process is the following:

  1. Start a new launch (test session) on the server
  2. Execute all tests: unit & integration tests (in my scenario).
  3. Close a launch on the server

As you see, I need to close a launch even in the case when tests failed. So I cannot stop an execution of build script directly on the failure. Unexpectedly, but FAKE provides an elegant solution for this scenario – FinalTarget (target that will be executed in any case if you activate it).

FAKE dependencies look like this in my script:

"Clean"
 ==> "RestorePackages"
 ==> "Build"
 =?> ("RP_StartNewLaunch", not <| hasBuildParam "skipTests")
 =?> ("RunUnitTests", not <| hasBuildParam "skipTests")
 =?> ("RunIntegrationTests", hasBuildParam "allTests")
 =?> ("RP_FinishLaunch", not <| hasBuildParam "skipTests")
 ==> "All"

Targets look like this:

Target "RP_StartNewLaunch" (fun _ ->
    ...
    ActivateFinalTarget "RP_FinishLaunch"
)

FinalTarget "RP_FinishLaunch" (fun _ ->
    ...
)

Target "RunUnitTests" (fun _ ->
    ...
)

Target "RunIntegrationTests" (fun _ ->
    ...
)

As you see, I defined FinalTarget instead of usual Target for “RP_FinishLaunch” and activated it on start of a new launch.

FAKE is awesome 😉

F# Weekly #1, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations/Courses

This week from F# Advent Calendar in English

This week from F# Advent Calendar in Japanese

Blogs

F# vNext News

New releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #52Subscribe

Twitter Pulse #fsharp 2014

Past two years, at the beginning of the year, I did a post where I have tried to sum up year results and find some interesting facts/stats from tweets:

This year was really awesome, a lot of things happened:

There are so many things occurred, so I need your help to find everything that happened or changed this year.

Especially for this, I prepared a data set with tweets starting from Jan 1, 2013 that is available here, and ask you to help me analyze it.

How to start:

  1. Download  the data set & unzip an archive.
  2. Download latest version of Fsharp.Data.
  3. Copy-paste following code snippet:
#r @"..\packages\FSharp.Data.2.1.1\lib\net40\FSharp.Data.dll"
open FSharp.Data

type Tweets = CsvProvider<"fsharp_2013-2014.csv">
let tweets = Tweets.GetSample()

//TODO: Your awesome analytics here

My sample analysis:

As an example of what you can do with data, I prepared a calculation of people activity that shows who had more tweets this year.

tweets.Rows
|> Seq.filter (fun x -> x.CreatedDate.Year = 2014)
|> Seq.groupBy (fun x -> x.FromUserScreenName)
|> Seq.map (fun (group, items) ->
    (group, Seq.length items))
|> Seq.sortBy (fun (_, cnt) -> -cnt)
|> Seq.take 100
|> Seq.iter (fun (group, cnt) ->
    printfn "%s:%d" group cnt)

When you execute these rows you will get a statistical output in FSI with user names and number of tweets. You can copy this output to wordle.net and play with settings to visualize it in the nice way:
2015-01-02_1007

Please help me to observe data set and share your results with me on Twitter (@sergey-tihon). I will include your plots/charts in the end of this post. Thank you!

Deploying .NET code instantly using Vagrant

The absolutely awesome post !!!

Eirik Tsarpalis's avatarEirik Tsarpalis' blog

This is post #30 of the English 2014 F# advent calendar. Thanks to Sergey Tihon for inviting me and suggesting the topic. Be sure to check out all the other awesome posts!

In this post I will be describing Vagrant, a dependency management library of mine. I will try to walk through some of the subtleties in the .NET framework that drove the library implementation, in an attempt to make it more accessible. All code and examples presented can be found in this repository.

Prelude

It is often claimed in functional programming that functions are treated as values. This is a valid assumption in simple applications, permitting powerful patterns when writing code. But is this a general truth, or simply a linguistic abstraction? If functions really are values, one would expect that they exhibit all properties normally expected of values. For instance, it should be possible to serialise functions…

View original post 1,027 more words

F# Weekly #52, 2014 – New Year Edition

Welcome to F# Weekly,

Thank you to everyone who have been with F# Weekly all this year! Happy New Year to all of you and your families!

Last portion of news from 2014:

News

Videos/Presentations/Courses

This week from F# Advent Calendar in English

This week from F# Advent Calendar in Japanese

Blogs

F# vNext News

New releases

That’s all for now.  Happy New Year and see you in the New 2015 Year!.

Previous F# Weekly edition – #51Subscribe

F# Weekly #51, 2014

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations/Courses

This week from F# Advent Calendar in English

This week from F# Advent Calendar in Japanese

Blogs

F# vNext News

New releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #50Subscribe

Review: F# Deep Dives

F# Deep Dive

Discount code: fshserb (39% off the eBook)

Some days ago, Manning published the final version of a new F# book: “F# Deep Dive“.  I have read MEAP version of the book, and even had a chance to review the final one.

Book is written by the team of famous F# experts such as: Chris Ballard, Keith Battocchi, Colin Bull, Chao-Jen Chen, Yan Cui, Johann Deneux, Kit Eason, Evelina Gabasova, Dmitry Morozov, Don Syme and composed by Tomas Petricek and Phillip Trelford.

First of all, I want to mention that it is not a usual book about F# or another programming language. If you are novice to F# and looking for a guide of language constructs – this book is not the best choice for you. BUT,  if you are already familiar with F# basic syntax constructs, can read simple F# code samples and want to see the language in action – this book is for you.

Book is organized as a collection of independent packages written by different authors. Each author tells his own story about F# application to a practical domain, shows how it was used, how it affected an application design and describes why it was done in such a way. Experts show an application of F# to financial and statistical models, internals of Fsharp.Formatting, numerical computing, social networks analysis, real-world usage of type providers, developing MVC application in idiomatic F#, power of F# Async in action, game development, social web apps in F# and many other interesting topics.

One problem with this book, at least for me, that it is difficult to read it cover to cover. Chapters are written by different authors in a different language, sometimes it was hard for me to catch a sense of computation in a completely new domain. So, for all future readers, I recommend to reorganize chapters according to interests and read parts that most valuable for you first.

Finally, I want to say that the book is really good. Everyone will find interesting topics and a new experience. You will get a broader vision of F# application in a real life. You will see how a functional approach can change and simplify the architecture of real life apps. If you are looking for what to read next – take a look at “F# Deep Dives“, this book is really deserves it.

If you want more F# books – visit fsharp.org.