LZW compression: Difference between revisions
Content added Content deleted
m (→{{header|Julia}}: update from Julia 0.6 to 1.1.1) |
m (→{{header|Haskell}}: make the types more general) |
||
Line 2,038: | Line 2,038: | ||
import Data.Maybe (fromJust) |
import Data.Maybe (fromJust) |
||
doLZW :: |
doLZW :: Eq a => [a] -> [a] -> [Int] |
||
doLZW _ [] = [] |
doLZW _ [] = [] |
||
doLZW as (x:xs) = lzw (return <$> as) [x] xs |
doLZW as (x:xs) = lzw (return <$> as) [x] xs |
||
Line 2,049: | Line 2,049: | ||
w_ = w ++ [x] |
w_ = w ++ [x] |
||
undoLZW :: |
undoLZW :: [a] -> [Int] -> [a] |
||
undoLZW _ [] = [] |
undoLZW _ [] = [] |
||
undoLZW a cs = |
undoLZW a cs = |