projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1997-05-26 05:58:06 by sof]
[ghc-hetmet.git]
/
ghc
/
compiler
/
tests
/
deSugar
/
ds035.hs
1
data CList = CNil | CCons Int# CList
2
3
mk :: Int# -> CList
4
mk n = case (n ==# 0#) of
5
0# -> CNil
6
_ -> CCons 1# (mk (n `minusInt#` 1#))
7
8
clen :: CList -> Int#
9
clen CNil = 0#
10
clen (CCons _ cl) = 1# +# (clen cl)
11
12
main = case len4_twice of
13
8# -> "bingo\n"
14
_ -> "oops\n"
15
where
16
list4 = mk 4#
17
len4 = clen list4
18
len4_twice = len4 +# len4