Skip to content

Instantly share code, notes, and snippets.

@kubaracek
Created February 21, 2019 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kubaracek/04be3cda43c7db900cbc09718d1c0b39 to your computer and use it in GitHub Desktop.
Save kubaracek/04be3cda43c7db900cbc09718d1c0b39 to your computer and use it in GitHub Desktop.
useWord :: Game.Word -> AvailableChars -> Maybe AvailableChars
useWord [] [] = Just []
useWord (a) [] = Nothing
useWord [] (a) = Just a
useWord (x:xs) (y)
| elem x y = useWord xs $ deleteFirst x y
| otherwise = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment