🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.lang.functional
Article #4

Re: Contest (Re: Has anyone programmed Real World Applications in Haskell.)

#4
From: Abe Seika
Date: Tue, 03 Dec 1996 00:00
44 lines
2107 bytes

In article <4473.849089918@rananim.ie.u-ryukyu.ac.jp>
	kono@ie.u-ryukyu.ac.jp (Shinji Kono) writes:

 > In article <ABE.96Nov27125831@suntory.hallab.co.jp> , 
 > 	abe@hallab.co.jp (Abe Seika) writes 
 > >$BNc$($P$"$N(B b $B$+$i(B 1 $B$G;O$^$k:G=i$N(B n $B8D$NFs?J?t$rI=$9<0!"(BHaskell $B$G$$$&(B
 > >		take n (filter ((=='1').head) b)
 > >$B$J$I$O2DG=$J$N$@$m$&$+$H$$$&$3$H$J$N$G$9!#(B
 > 
 > $B$b$A$m$s!"$G$-$^$9$h!#(Bbugof,setof,findall$B$_$?$$$J$b$N$G$9$+$i!#(B
 > $B$?$@$7!"(Bbugof$B$J$I$O(Bpure logical$B$G$O$"$j$^$;$s$1$I$M!#(B


bagof $B$J$k!V=R8l!W$r;H$C$F!V=R8l$GI=8=$5$l$?L58B%j%9%H!W$N@hF,$NFs$D$N(B
$BMWAG$r<h$m$&$H$$$&;n$_$G$9!#(B

	b([]).
	b([A|B]):-b(B),(A=0;A=1).

	?- bagof(N,b(N),[First|[Second|_]]).

$B%a%b%j!<$r?)$$DY$7$FMn$A$F$7$^$$$^$7$?!"$I$&$bG.?4$K!VL58B%j%9%H!W$r(B
$B:n$m$&$H$7$F$$$i$C$7$c$k$h$&$G$9!#(B

	?- bagof(N,b(N),_).

$B$J$I$G$bF1$8$G$9!#=hM}7O$O(B wamcc $B$H$+$$$&$b$N$G$9!#$3$l$,4|BT$I$*$jF0(B
$B$$$F$/$l$k=hM}7O$OB8:_$7$^$9$+!)(B $B$R$g$C$H$7$F(B Lazy Prolog $B$J$s$F$N$,$"(B
$B$k$N$+$J!)(B

$B0l1~(B Followup-To: fj.lang.prolog $B$K$7$H$-$^$9!#(B



$B$5$F%3%s%F%9%H$G$9$,!"$b$&1~Jg$b$J$$$h$&$G$9$N$G@h$NA0ED$5$s$N:nIJ$r(B
$BM%>!:nIJ$H$5$;$F$$$?$@$-$^$9!#(B

$B$"$j$,$H$&$4$6$$$^$7$?!#(B

--
						      ($B3t(B) HAL $B8&5f=j(B  $B0$It@52B(B
						      abe@hallab.co.jp
Technical Details
Message-ID: <ABE.96Dec3145418@suntory.hallab.co.jp>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <ABE.96Nov27125831@suntory.hallab.co.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS
X-Google-Thread: f5c49,17d35f23f1af1fcb,start
X-Google-Attributes: gidf5c49,public
X-Google-Thread: 1217ff,17d35f23f1af1fcb,start
X-Google-Attributes: gid1217ff,public
From: abe@hallab.co.jp (Abe Seika)
Subject: Re: Contest (Re: Has anyone programmed Real World Applications in Haskell.)
Date: 1996/12/03
Message-ID: <ABE.96Dec3145418@suntory.hallab.co.jp>
X-Deja-AN: 202046237
distribution: fj
sender: usenet@hallab.co.jp
x-nntp-posting-host: suntory.hallab.co.jp
references: <ABE.96Nov27125831@suntory.hallab.co.jp>
followup-to: fj.lang.prolog
organization: HAL Laboratory, Inc. Tokyo, Japan
newsgroups: fj.lang.functional,fj.lang.prolog