Guest User

Untitled

a guest
Jun 25th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. private static List<object> GetParams(Microsoft.FSharp.Collections.List<object> inparams)
  2. {
  3. List<object> parameters = new List<object>();
  4. while (inparams != null)
  5. {
  6. parameters.Add(inparams.Head);
  7. inparams = inparams.Tail;
  8. }
  9. return inparams;
  10. }
  11.  
  12. new List<LiteralType>(parameters);
  13.  
  14. using System;
  15. using System.Collections.Generic;
  16. using Microsoft.FSharp.Collections;
  17. public static class FSharpInteropExtensions {
  18. public static FSharpList<TItemType> ToFSharplist<TItemType>(this IEnumerable<TItemType> myList)
  19. {
  20. return Microsoft.FSharp.Collections.ListModule.of_seq<TItemType>(myList);
  21. }
  22.  
  23. public static IEnumerable<TItemType> ToEnumerable<TItemType>(this FSharpList<TItemType> fList)
  24. {
  25. return Microsoft.FSharp.Collections.SeqModule.of_list<TItemType>(fList);
  26. }
  27. }
  28.  
  29. var lst = new List<int> { 1, 2, 3 }.ToFSharplist();
  30.  
  31. let public GetListElementAt i = mylist.[i]
Add Comment
Please, Sign In to add comment