Skip to content

Instantly share code, notes, and snippets.

@NotTheEconomist
Created November 1, 2017 17:01
Show Gist options
  • Save NotTheEconomist/11ebc9630e6c01ec800513071d6ad421 to your computer and use it in GitHub Desktop.
Save NotTheEconomist/11ebc9630e6c01ec800513071d6ad421 to your computer and use it in GitHub Desktop.
everyOther :: [a] -> [a]
everyOther xs = [v | (k,v) <- zip (cycle [True, False]) xs, k]
betweenAF :: String -> Bool
betweenAF = all (flip elem ['a'..'f']) . everyOther
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment