Is there any use for porting the Haskell Edison and Core APIs to F #?

Edison API Modules and Kernels are a Haskell implementation of purely functional data structures

Do F # and native.Net data structures set when used in the Edison API and Core?

Will there be any benefit in trying to connect the Haskell API and CORE modules to F #?

+3
source share
3 answers

I have not read the edison document , but if it is nothing but a Haskell implementation of Purely Functional Data Structures, does it make sense to transfer the SML code to the book / thesis? This should be simpler than porting Haskell code, which should be annotated for strictness, while F # should be annotated for laziness.

The language used by the book is SML with syntax extensions for lazy evaluation. F # provides half of these extensions natively:

> let x = lazy 12;;
val x : Lazy<int> = <unevaluated>
> match x with
  | Lazy(n) -> n;;
val it : int = 12
> x;;
val it : Lazy<int> = 12

To convert a book notation fun lazy, change this:

fun lazy plus ($m, $n) = $m + n

For this:

let plus (m',n') = lazy (
  match (m',n') with
  | (Lazy(m), Lazy(n)) -> (lazy (m + n)).Force())

(see page 33 in the book). The differences between SML and F # are a little syntax, so translation should be easy.

, , , .NET, Set Map F #. , , .

+7

, . , ( , API Edison).

, "- " , " FP" " ", .

( ), , , API- F # .Net, . "" , , F # (Set and Map), .Net 4.0 /a > (, ConcurrentQueue).

, , Jomo .

+4

Source: https://habr.com/ru/post/1720708/


All Articles