sln_2017_04
Copyright(c) Eric Mertens 2017
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

Synopsis

Documentation

main :: IO () Source #

allUnique :: Ord a => [a] -> Bool Source #

Predicate that returns true when all elements in the list are unique

>>> allUnique (words "aa bb cc dd ee")
True
>>> allUnique (words "aa bb cc dd aa")
False
>>> allUnique (words "aa bb cc dd aaa")
True

allUniqueModuloAnagrams :: Ord a => [[a]] -> Bool Source #

Predicate that returns true when all elements in the list are unique when considering anagrams equal to each other.

>>> allUniqueModuloAnagrams (words "abcde fghij")
True
>>> allUniqueModuloAnagrams (words "abcde xyz ecdab")
False
>>> allUniqueModuloAnagrams (words "a ab abc abd abf abj")
True
>>> allUniqueModuloAnagrams (words "iiii oiii ooii oooi oooo")
True
>>> allUniqueModuloAnagrams (words "oiii ioii iioi iiio")
False