Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. tuple space (Mike Houghton) 2. Re: tuple space (Imants Cekusins) 3. Re: tuple space (Mike Houghton) 4. Re: tuple space (Tony Morris) 5. Re: tuple space (Imants Cekusins) 6. Re: tuple space (Mike Houghton) ---------------------------------------------------------------------- Message: 1 Date: Fri, 5 Feb 2016 21:37:07 +0000 From: Mike Houghton <mike_k_hough...@yahoo.co.uk> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: [Haskell-beginners] tuple space Message-ID: <abc3d94f-b15d-4b43-87f2-d62e27462...@yahoo.co.uk> Content-Type: text/plain; charset=utf-8 Hi, I?m thinking about how to write a Tuple Space (TS) in Haskell. A tuple can have many fields of different types, in pseudo code something like T = (1, ?A string?, 3.4) i.e. an int, string and double. How can this (and the many variations) be done in Haskell? (In Java it would be a list of Object) Thanks Mike ------------------------------ Message: 2 Date: Fri, 5 Feb 2016 22:43:42 +0100 From: Imants Cekusins <ima...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] tuple space Message-ID: <CAP1qinadU-tySn=ezttyu3hsuhfdshocgoatxmeg1qsjz16...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 > T = (1, ?A string?, 3.4) i.e. an int, string and double. would this suit: data Object = Int' Int | Double' Double | String' String type T = [Object] ? ------------------------------ Message: 3 Date: Fri, 5 Feb 2016 21:58:30 +0000 From: Mike Houghton <mike_k_hough...@yahoo.co.uk> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] tuple space Message-ID: <1ec98f6e-7610-485b-a3f1-57ba62f3a...@yahoo.co.uk> Content-Type: text/plain; charset=utf-8 Thanks for the quick reply! No, that wouldn?t work as that would tie a tuple to Int, Double,String for all tuples. (1,1,2,3,?string?, 4.5, ?string?, 1) is also valid tuple In Java I would use List<Object> so any number of (non-primitives) can be used. Thanks Mike > On 5 Feb 2016, at 21:43, Imants Cekusins <ima...@gmail.com> wrote: > >> T = (1, ?A string?, 3.4) i.e. an int, string and double. > > would this suit: > > data Object = Int' Int | Double' Double | String' String > type T = [Object] > > ? > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ Message: 4 Date: Sat, 6 Feb 2016 08:03:32 +1000 From: Tony Morris <tmor...@tmorris.net> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] tuple space Message-ID: <cajf6usicc46e87vsqwrawv2nt8wdm-tqsyyncrcor5jxpee...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" HList. Also in Java, you'd use HList (never use Object). http://www.functionaljava.org/javadoc/4.0/fj/data/hlist/HList.html On Sat, Feb 6, 2016 at 7:58 AM, Mike Houghton <mike_k_hough...@yahoo.co.uk> wrote: > Thanks for the quick reply! > > No, that wouldn?t work as that would tie a tuple to Int, Double,String for > all tuples. > > (1,1,2,3,?string?, 4.5, ?string?, 1) is also valid tuple > > In Java I would use > List<Object> so any number of (non-primitives) can be used. > > Thanks > > Mike > > > > On 5 Feb 2016, at 21:43, Imants Cekusins <ima...@gmail.com> wrote: > > > >> T = (1, ?A string?, 3.4) i.e. an int, string and double. > > > > would this suit: > > > > data Object = Int' Int | Double' Double | String' String > > type T = [Object] > > > > ? > > _______________________________________________ > > Beginners mailing list > > Beginners@haskell.org > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160206/77c4dbb7/attachment-0001.html> ------------------------------ Message: 5 Date: Fri, 5 Feb 2016 23:06:40 +0100 From: Imants Cekusins <ima...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] tuple space Message-ID: <cap1qinzryht9o1jmhmvtdigsig+4grgidxw7qqt6odv2vz+...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 > (1,1,2,3,?string?, 4.5, ?string?, 1) is also valid tuple [Int' 1, Int' 1, Int' 2, Int' 3, String' "string", Double' 4.5, String' "string", Int 1] not sure about Double but the rest should be ok. try it! ------------------------------ Message: 6 Date: Fri, 5 Feb 2016 22:10:04 +0000 From: Mike Houghton <mike_k_hough...@yahoo.co.uk> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] tuple space Message-ID: <ca6b0f32-b544-48e7-bb5f-e2cb8ed29...@yahoo.co.uk> Content-Type: text/plain; charset="utf-8" Nice, thanks. > On 5 Feb 2016, at 22:03, Tony Morris <tmor...@tmorris.net> wrote: > > HList. > > Also in Java, you'd use HList (never use Object). > http://www.functionaljava.org/javadoc/4.0/fj/data/hlist/HList.html > <http://www.functionaljava.org/javadoc/4.0/fj/data/hlist/HList.html> > > On Sat, Feb 6, 2016 at 7:58 AM, Mike Houghton <mike_k_hough...@yahoo.co.uk > <mailto:mike_k_hough...@yahoo.co.uk>> wrote: > Thanks for the quick reply! > > No, that wouldn?t work as that would tie a tuple to Int, Double,String for > all tuples. > > (1,1,2,3,?string?, 4.5, ?string?, 1) is also valid tuple > > In Java I would use > List<Object> so any number of (non-primitives) can be used. > > Thanks > > Mike > > > > On 5 Feb 2016, at 21:43, Imants Cekusins <ima...@gmail.com > > <mailto:ima...@gmail.com>> wrote: > > > >> T = (1, ?A string?, 3.4) i.e. an int, string and double. > > > > would this suit: > > > > data Object = Int' Int | Double' Double | String' String > > type T = [Object] > > > > ? > > _______________________________________________ > > Beginners mailing list > > Beginners@haskell.org <mailto:Beginners@haskell.org> > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > > <http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners> > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org <mailto:Beginners@haskell.org> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > <http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners> > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160205/1a667d60/attachment.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 92, Issue 7 ****************************************