Oct. 14th, 2013
found on some company's page
Oct. 14th, 2013 11:24 amfunction changeLanguageOrder(){ if(null!=document.documentElement.lang && null!=document.getElementById('selectedLanguage')){ if(document.documentElement.lang=="es"){ document.getElementById('selectedLanguage').options[1].selected=true; } else if(document.documentElement.lang=="ht"){ document.getElementById('selectedLanguage').options[2].selected=true; } else if(document.documentElement.lang=="il"){ document.getElementById('selectedLanguage').options[3].selected=true; } else if(document.documentElement.lang=="ko"){ document.getElementById('selectedLanguage').options[4].selected=true; } else if(document.documentElement.lang=="tl"){ document.getElementById('selectedLanguage').options[5].selected=true; } else if(document.documentElement.lang=="vi"){ document.getElementById('selectedLanguage').options[6].selected=true; } else if(document.documentElement.lang=="zh" || document.documentElement.lang=="zt"){ document.getElementById('selectedLanguage').options[7].selected=true; } else { document.getElementById('selectedLanguage').options[0].selected=true; } }
A weird selection of languages, is not it?
val listMaybe: Result[List[X]] = ...
val extractionResults: Result[List[Result[Y]]] = listMaybe map process
extractionResults map traverse flatten
I have a result of type
Result[List[Result[Y]]]
; now I traverse the internal list (if it exists), obtaining Result[Result[List[Y]]]
, then I have to flatten it to get Result[List[Y]]
.Either I'm doing something non-kosher, or I need a word for this "map traverse flatten" thingie.