Skip to content

Instantly share code, notes, and snippets.

View kpgalligan's full-sized avatar

Kevin Galligan kpgalligan

View GitHub Profile
@kpgalligan
kpgalligan / gist:6584675
Last active December 23, 2015 05:09 — forked from jrm2k6/gist:6584648
import System.Environment (getArgs)
stringToArray :: String -> [String]
stringToArray s = words s
findLongestWord :: String -> [String] -> String
findLongestWord x [] = x
findLongestWord l (w1:s1)
| length w1 > length l = findLongestWord w1 s1
| otherwise = findLongestWord l s1