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. 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 <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Rose tree
Message-ID: <[email protected]>
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 <[email protected]> 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 <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
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 <[email protected]>
To: Haskell Beginners <[email protected]>
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
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 103, Issue 4
*****************************************