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