Problem 3 Solutions

Solution 1

elementAt : List a -> Int -> Maybe a 
elementAt list n = 
    case List.drop (n - 1) list of 
        [] -> 
            Nothing 

        y :: ys -> 
            Just y

Back to Problem 2

results matching ""

    No results matching ""