fork download
  1. type LinkedList<'T> =
  2. Cons of 'T * LinkedList<'T>
  3. | Nil
  4.  
  5. module LinkedList =
  6. let map f = function
  7. Cons (head, tail) -> Cons (f head, map tail)
  8. | Nil -> Nil
  9.  
  10. let start = Cons (1, Cons (2, Cons (3, Nil)))
  11. let end = LinkedList.map (~-) start
  12.  
  13. printf "%A\n%A" start end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/p7Y11b/prog.fs(11,5): error FS0010: Incomplete structured construct at or before this point in binding
stdout
Standard output is empty