b310e3830633e5c65f1519efd0e5dea7d2e320e1
[ghc-hetmet.git] / ghc / tests / specialise / spec002 / Main.hs
1 -- Generation of BigTuples ... 
2
3 module Main where
4
5 -- import Other (bigtuple2, untuple2)
6
7 bigtuple2 = bigtuple1
8 untuple2  = untuple1
9
10 main = do
11     input <- getContents
12     putStr (unlines (map dolist (lines input)))
13
14 dolist l = untuple1 (bigtuple1 l) ++ ['\n'] ++ untuple2 (bigtuple2 l)
15
16 bigtuple1 (a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:a':b':c':d':e':f':g':h':i':j':k':l':m':n':rest)
17   = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a',b',c',d',e',f',g',h',i',j',k',l',m',n') : bigtuple1 rest
18 bigtuple1 _ = []
19
20 untuple1 ((a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a',b',c',d',e',f',g',h',i',j',k',l',m',n'):rest)
21   = a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:a':b':c':d':e':f':g':h':i':j':k':l':m':n': untuple1 rest
22 untuple1 []
23   = []