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