[Haskell-cafe] How to devide matrix into small blocks
daniel.is.fischer at web.de
Thu Jun 14 15:26:09 EDT 2007
blocks w h = concatMap transpose . map (map (chop w)) . chop h
map concat . blocks w h
is what you want.
Am Donnerstag, 14. Juni 2007 09:42 schrieb Janis Voigtlaender:
> Anyway, as a challenge to others on the list: write a one-liner that
> splits an "image" like ["abcd","efgh","ijkl","mnop"], interpreted as
> into the list of images:
> for (w,h)=(2,2), into:
> for (w,h)=(1,2), and so on.
> (Where an image like
> is represented as ["ab","ef"].)
> Have fun, Janis.
More information about the Haskell-Cafe