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. Re: Rose tree (mike h) 2. Autogenerating tuple constructor of length n (Manikanda Krishnan) 3. dynamic code compilation and loading (Dennis Raddle) ---------------------------------------------------------------------- Message: 1 Date: Mon, 9 Jan 2017 21:06:35 +0000 From: mike h <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] Rose tree Message-ID: <447e2083-42af-4ba9-84c0-baa2a5f4c...@yahoo.co.uk> Content-Type: text/plain; charset=utf-8 add :: Eq a => a -> a -> RoseTree a -> RoseTree a add x px (Node x' []) = Node x' [Node x []] add x px (Node x' trees) | px == x' = Node x' $ (Node x []):trees | otherwise = Node x' $ (add x px) <$> trees seems to be correct. :) > On 8 Jan 2017, at 20:06, mike h <mike_k_hough...@yahoo.co.uk> wrote: > > Hi, > > I’m rapidly descending into a spiral of confusion! :) > > How do I add something to a rose tree? > > I have > > data Tree a = Node a [Tree a] deriving (Show) > > add :: Eq a => a -> a -> Tree a -> Tree a > > and the first ‘a’ is the thing to add and the second is its parent node. > i.e. > add :: Eq a => a -> a -> Tree a -> Tree a > add x px (Node x' []) = Node x' [Node x []] > ….. > > I’ve tried various ways for the more general case but always seem to lose > part of the tree. > > Any advice would be very welcome. > > Thanks > > Mike ------------------------------ Message: 2 Date: Tue, 10 Jan 2017 07:47:17 +0530 From: Manikanda Krishnan <vmk8...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <Beginners@haskell.org> Subject: [Haskell-beginners] Autogenerating tuple constructor of length n Message-ID: <cac_d3yxv7abwz5dyozubfyld2c0mxrwonwhmdjyqa4pe6c_...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hi, I am exploring haskell. Is there a way to generate a tuple constructor of n elements at runtime? Basically I want to convert a list of lists into a list of n tuples. Thanks in advance Mani -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170110/708b3fb1/attachment-0001.html> ------------------------------ Message: 3 Date: Mon, 9 Jan 2017 18:45:05 -0800 From: Dennis Raddle <dennis.rad...@gmail.com> To: Haskell Beginners <beginners@haskell.org> Subject: [Haskell-beginners] dynamic code compilation and loading Message-ID: <cakxlvoqoshqkvbztt2pcnbgtwdyiet31sr5qkjntkopwx9q...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Can I get a pointer to how to do dynamic code compilation and loading into a running program? D -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170109/d8f661e3/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 103, Issue 4 *****************************************