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. module Program =
  11. let start = Cons (1, Cons (2, Cons (3, Nil)))
  12. let end = LinkedList.map (~-) start
  13.  
  14. printf "%A\n%A" start end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/Qc1Zwy/prog.fs(12,7): error FS0010: Incomplete structured construct at or before this point in binding
stdout
Standard output is empty