Send Beginners mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

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 <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] tuple space
Message-ID: <[email protected]>
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 <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
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 <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tuple space
Message-ID: <[email protected]>
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 <[email protected]> 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
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



------------------------------

Message: 4
Date: Sat, 6 Feb 2016 08:03:32 +1000
From: Tony Morris <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
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 <[email protected]>
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 <[email protected]> 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
> > [email protected]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> 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 <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
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 <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tuple space
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Nice, thanks.

> On 5 Feb 2016, at 22:03, Tony Morris <[email protected]> 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 <[email protected] 
> <mailto:[email protected]>> 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 <[email protected] 
> > <mailto:[email protected]>> 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
> > [email protected] <mailto:[email protected]>
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners 
> > <http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners>
> 
> _______________________________________________
> Beginners mailing list
> [email protected] <mailto:[email protected]>
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners 
> <http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners>
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> 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
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 92, Issue 7
****************************************

Reply via email to