Skip to content

ex2 4

← Back

Basic Info

Functional Programming
└── Lab ML
    └── 0​307
        └── ex2 4.sml

Preview

(*Compute the length of a list*)

fun length L =
    if L = nil
    then 0
    else 1 + length(tl(L))
;