projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
ead7d65d252cc9663d331493d5af89ba484cf54c
[ghc-hetmet.git]
/
ghc
/
tests
/
array
/
should_run
/
arr010.hs
1
--!!! Array - accumulated arrays
2
--
3
--
4
module Main(main) where
5
6
import Array
7
import Ix
8
9
hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b
10
hist bnds is = accumArray (+) 0 bnds [(i,1) | i <- is , inRange bnds i]
11
12
main =
13
let
14
a1 = hist (0,10) (concat $ take 2 $ repeat [1..20])
15
in
16
print a1
17
18