Skip to content

Instantly share code, notes, and snippets.

@parsonsmatt
Last active October 15, 2015 00:27
Show Gist options
  • Save parsonsmatt/2632bea0c4b7da38eac9 to your computer and use it in GitHub Desktop.
Save parsonsmatt/2632bea0c4b7da38eac9 to your computer and use it in GitHub Desktop.
allDifferent :: Ord d => [ID] -> Constraints d
allDifferent ids = do
domains <- forM ids (use . domainAt)
let unified = mconcat domains
newDomains = map (\d -> d \\ (unified \\ d)) domains
zipWithM_ updateVariable ids newDomains
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment