Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Brian Adkins Newsgroups: comp.lang.functional Subject: Re: Converting list comprehensions to Standard ML Date: Sat, 04 Jun 2011 19:54:38 -0400 Organization: A noiseless patient Spider Lines: 23 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="DjJrb2y51t4k+9WEuu4C0g"; logging-data="28063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jTMV+FTURmwpvrl6MJwpM" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:fijVEjqNvv4DT4Amv5jYD74dFiI= sha1:aYxaWJVqBID4EvmLU4CCg5MGLIU= Xref: x330-a1.tempe.blueboxinc.net comp.lang.functional:124 Thomas Thiel writes: > [...] > > infix 1 >>= > infix 2 when > > fun upTo n = List.tabulate (n+1, fn x => x) > > fun xs >>= f = List.concat (map f xs) > > fun a when b = if b then [a] else [] > > > fun lc predicate = > upTo 4 >>= (fn r => > upTo r >>= (fn c => (r,c) when (predicate (r, c)))) Thanks - I'll experiment with that. -- Brian Adkins http://lojic.com/