One simple reason is that seq<'T> is lazy.

By on 5/2/2016 3:04 AM ()

I am fine with the result being non-lazy; that is, Content.Json iterates over the seq<'T> and generates a JSON list of 'T Json. That would be the preferred behavior because then my backend code can return seq<'T> types that do all sort of useful things (e.g. iterate over a flatten seq of a subsequences) Does F# have some limitation with type reflection or duck typing that prevents this, or is this breaking some design guideline.

A second feature request would be to support an interface type for custom JSON representations something like

type IJsonSerialize = interface abstract ToJSON : unit -> string end

If there isn't any serious reason why it couldn't be supported, I can start to look through the code base and see if something can be prototyped to suit my needs.

By on 5/2/2016 4:05 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper