Chaocipher: Difference between revisions
m
→{{header|Haskell}}: Tidied one function in applicative terms.
m (fix end HTML tab.) |
m (→{{header|Haskell}}: Tidied one function in applicative terms.) |
||
Line 840:
<lang haskell>import Data.List (elemIndex)
chao
chao :: Eq a => [a] -> [a] -> Bool -> [a] -> [a]▼
:: Eq a
chao _ _ _ [] = []
chao l r plain (x:xs) = maybe [] go (elemIndex x src)
Line 856 ⟶ 858:
rotated :: Int -> [a] -> [a]
rotated
shifted :: Int -> Int -> [a] -> [a]
shifted src dst s = concat [x, rotated 1 y, b]
where
encode = False
|