ML function

 

Write a recursive ML function that uses pattern matching with name/type
optconcat : char option list -> string

that inputs a list of char options, and returns a single string consisting of all characters on the list concatenated together while ignoring any instances of NONE. For example,

– optconcat([SOME #”b”,NONE,SOME #”o”,SOME #”o”,NONE]);

val it = “boo” : string

– optconcat([NONE,NONE]);

val it = “” : string

This question has been answered.

Get Answer