projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1997-12-19 12:22:06 by simonm]
[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