[project @ 1997-07-27 00:43:10 by sof]
[ghc-hetmet.git] / ghc / tests / programs / jl_defaults / Main.hs
1 d=25637784375346753+0158409406114519728029864689069987389733-25637784375346753
2
3 cox(n)=foldr   (\x(y)->128*      y+x)0(n)
4 de(n)=un(\x->  (x`mod`128,x    `div`128),(                  ==0))n
5 coll=    un(\  zs->(          take(   35)zs,          drop(35)zs),(==""))
6 pe(n,m)x=s(p(  n`div`2,m)x)  `mod`m   --2323         -- john launchbury --
7 p(n,m)x=if(    n==0)then(1)  else(if(even(n))    then(pe(n,m)x)else(po(n,m)x))
8 po(n,  m)x=           (x*p(  n-1,m)   x)`mod`                 m
9 un(f,   p)n=   if(p(n))then  []else   (let(a,       b)=f(n)in(a:un(f,p)b))
10 (g,s)    =(\x  ->x,\x->x*x)  --v(f)   t*g+172
11
12 e=4998372704153806867349631861645896723396264061670520817438963311707989737197
13 n=6133011105483442903214719346445720362447680717496623906453276570566830154479
14
15 a=g
16   (concat.map(map(chr.fromIntegral).de.p(d,n).read).lines)
17 main=interact
18   (unlines.map(show.p(e,n).cox.map(fromIntegral.ord)).coll)
19 b=g
20 --p::(Integer,Integer)->Integer->Integer
21 default (Integer)
22 -- 1.3
23 ord = (fromEnum :: Char -> Int)
24 chr = (toEnum   :: Int  -> Char)