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. Converting a data type to an abstract data type (Ryan Warner) 2. Re: Converting a data type to an abstract data type (Christopher Allen) 3. Re: [Haskell-cafe] Powerset of a set (Francesco Ariis) 4. Re: Converting a data type to an abstract data type (amin...@gmail.com) 5. Re: Converting a data type to an abstract data type (Kim-Ee Yeoh) ---------------------------------------------------------------------- Message: 1 Date: Mon, 14 Sep 2015 18:23:08 +0000 From: Ryan Warner <ryan.warner.mn+hask...@gmail.com> To: "beginners@haskell.org" <beginners@haskell.org> Subject: [Haskell-beginners] Converting a data type to an abstract data type Message-ID: <CAMV_cL0R4gQb74bQHVMApOdeQ=K=qhjepm-eicilkco5gqm...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" I had defined a data type similar to the following: data Record = Record { name :: String, age :: Int } Later, I realized I needed it be an ADT defined like: data Record a = Record { name :: String, age :: Int, resource :: a } The change turned out to be fairly well contained and probably only took me a half hour to propagate up. However, I see the potential for this to be a bigger job. Are there any editors that automate that kind of refactoring? -Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150914/74dd2748/attachment-0001.html> ------------------------------ Message: 2 Date: Mon, 14 Sep 2015 13:24:43 -0500 From: Christopher Allen <c...@bitemyapp.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Cc: Alan & Kim Zimmerman <alan.z...@gmail.com> Subject: Re: [Haskell-beginners] Converting a data type to an abstract data type Message-ID: <cadnndorcbp9gtbdnvohvhett7zkts4gszrh4gxo4e+fagl3...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Maybe Alan Zimmerman's Haskell refactorer project is pertinent? I don't think they're anything ready-to-use though. On Mon, Sep 14, 2015 at 1:23 PM, Ryan Warner < ryan.warner.mn+hask...@gmail.com> wrote: > I had defined a data type similar to the following: > > data Record = Record { name :: String, age :: Int } > > Later, I realized I needed it be an ADT defined like: > data Record a = Record { name :: String, age :: Int, resource :: a } > > The change turned out to be fairly well contained and probably only took > me a half hour to propagate up. However, I see the potential for this to be > a bigger job. Are there any editors that automate that kind of refactoring? > > -Ryan > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > > -- Chris Allen Currently working on http://haskellbook.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150914/b6683eff/attachment-0001.html> ------------------------------ Message: 3 Date: Mon, 14 Sep 2015 21:18:55 +0200 From: Francesco Ariis <fa...@ariis.it> To: haskell-c...@haskell.org, beginners@haskell.org Subject: Re: [Haskell-beginners] [Haskell-cafe] Powerset of a set Message-ID: <20150914191855.ga8...@casa.casa> Content-Type: text/plain; charset=us-ascii On Mon, Sep 14, 2015 at 01:57:10PM -0500, JORGE MALDONADO wrote: > The powerset of set s is a set containing all subsets of s. > I need a clue on how to write Haskell code to get the superset of a set > using direct recursion and list comprehension. > > Best regads. This is good for haskell-beginners rather than haskell cafe. Clue: - say you have a list `l` [a,b,c,d,e] - you have the powerset of list `m` [b,c,d,e] - how can you use the `powerset of m` to calculate the `powerset of l`? ------------------------------ Message: 4 Date: Mon, 14 Sep 2015 17:01:25 -0400 From: amin...@gmail.com To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Cc: "beginners@haskell.org" <beginners@haskell.org> Subject: Re: [Haskell-beginners] Converting a data type to an abstract data type Message-ID: <19823829-84bc-4ea9-b3fe-67d25a520...@gmail.com> Content-Type: text/plain; charset=utf-8 The term you're looking for is "parameterized," not "abstract." An abstract data type is something else. Can't help with your original question though, sorry! tom El Sep 14, 2015, a las 14:23, Ryan Warner <ryan.warner.mn+hask...@gmail.com> escribi?: > I had defined a data type similar to the following: > > data Record = Record { name :: String, age :: Int } > > Later, I realized I needed it be an ADT defined like: > data Record a = Record { name :: String, age :: Int, resource :: a } > > The change turned out to be fairly well contained and probably only took me a > half hour to propagate up. However, I see the potential for this to be a > bigger job. Are there any editors that automate that kind of refactoring? > > -Ryan > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ Message: 5 Date: Tue, 15 Sep 2015 10:16:29 +0700 From: Kim-Ee Yeoh <k...@atamo.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Converting a data type to an abstract data type Message-ID: <capy+zdqapbbz5hfnvezauz3ux_8xew8tcpju1y5zovhnjr7...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On Tue, Sep 15, 2015 at 1:23 AM, Ryan Warner < ryan.warner.mn+hask...@gmail.com> wrote: > However, I see the potential for this to be a bigger job. Are there any > editors that automate that kind of refactoring? Let me ask: for this smaller scenario, what were the repetitive activities? Specifically, how would automation alleviate the labor? As for the potential for this to be a bigger job, aren't there ways of minimizing such blowup risks in the first place? What can be done to avoid incrementalizing on data design? -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150915/2b5b8636/attachment-0001.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 87, Issue 6 ****************************************