Teacup rim text: Difference between revisions
Content deleted Content added
m →{{header|Haskell}}: tidying |
|||
Line 44: | Line 44: | ||
isCircular :: S.Set String -> String -> Bool |
isCircular :: S.Set String -> String -> Bool |
||
isCircular lex w = |
isCircular lex w = |
||
2 < length w && all (`S.member` lex) (rotations w) |
|||
rotations :: [a] -> [[a]] |
rotations :: [a] -> [[a]] |
||
rotations = liftA2 fmap rotated (enumFromTo 0 . pred . length) |
rotations = liftA2 fmap rotated (enumFromTo 0 . pred . length) |