By on 5/8/2010 3:03 PM ()

Regarding the incomplete pattern match warning you can omit the second guard or
avoid guards altogether and write :

1
2
3
4
5
6
7
8
9
10
 

let rec nth n l =
    match n, l with
    | 0, _ -> l
    | _, None -> None
    | _, Node(node) ->
        if n > 0
        then nth (n-1) node.Next
        else nth (n+1) node.Prev
By on 5/8/2010 3:50 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper