Teacup rim text: Difference between revisions

→‎{{header|Haskell}}: Dropped import of liftA2 from second version
(→‎{{header|Haskell}}: Dropped import of liftA2 from second version)
Line 160:
Or taking a different approach, we can avoid the use of Data.Set by obtaining groups of anagrams (of more than two characters) from the lexicon, and filtering out a circular subset of these:
<lang haskell>import Data.List (groupBy, intercalate, sort, sortBy)
import Control.Applicative (liftA2)
import Data.Ord (comparing)
import Data.Function (on)
Line 187 ⟶ 186:
 
rotations :: [a] -> [[a]]
rotations = liftA2 take <$> length <*> (iterate rotated)
 
rotated :: [a] -> [a]
9,655

edits