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:  trees on Haskell : Do I understand it right  ? (Joel Neely)
   2. Re:  trying to install libraries for Haskell School of
      Expression (emacstheviking)
   3. Re:  trees on Haskell : Do I understand it right ? (Roelof Wobben)


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

Message: 1
Date: Sun, 1 Mar 2015 07:45:24 -0600
From: Joel Neely <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] trees on Haskell : Do I understand it
        right   ?
Message-ID:
        <CAEEzXAi=tn_+wmyqfqhn7pujvv0gc-nxt3g3kcu6ogw_fqt...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Roelof,

Perhaps it would help for you to draw diagrams for the cases you're working.
If a leaf has nothing below it, and a node always has exactly three things
below it (the left child, the message, and the right child),
what would your picture look like for 1, 2, and 3 nodes?
And how would you write out constructor expressions that match those shapes?

Hope that helps,
-jn-


On Thu, Feb 26, 2015 at 12:32 PM, Roelof Wobben <[email protected]> wrote:

>  Oke,
>
> I send it a second time but now in plain text.
>
> So for 3 it will be like this :
>
> Node = Node  (Node Leaf "msg1" Leaf) (Node Leaf "msg2") (Node  "msg3"
> Leaf)  ???
>
>
> Roelof
>
>
>
>
>
> Konstantine Rybnikov schreef op 26-2-2015 om 15:08:
>
>  In my second example you can see a minimal node with a message:
>
> node = Node Leaf "msg" Leaf
>
>  Instead of either left or right Leaf you can put another value of type
> MessageTree, for example:
>
>  node = Node Leaf "msg1" (Node Leaf "msg2" Leaf)
>
> On Thu, Feb 26, 2015 at 4:01 PM, Roelof Wobben <[email protected]> wrote:
>
>>  Oke,
>>
>> So a leaf is a node which has no "branch"
>>
>> I have made a exercise where I have to made the  logMessages.
>> Now I have to turn them into a tree
>>
>> Where does the second entry goes then ?
>>
>> Roelof
>>
>>
>> Konstantine Rybnikov schreef op 26-2-2015 om 14:56:
>>
>>     Hi Roelof,
>>
>>  I think you misunderstood it.
>>
>>  There are two things here: types and values (value-constructors). They
>> exist in different world, not touching each other.
>>
>>  In Haskell, you define a type as:
>>
>>  data <Type_Name> = <ValueConstructor_Name> <Type_Name> <Type_Name>
>> <Type_Name>
>>
>>  You can create values as:
>>
>>  let varName = <ValueConstructor_Name> <Value> <Value> <Value>
>>
>>  You need to put <Value> of some type, not type name itself in place of
>> those <Value>s.
>>
>>  So, with datatype you provided, you have two data-constructors:
>>
>>  Leaf
>>
>>  and
>>
>>  Node <val> <val> <val>
>>
>>  You can create a leaf:
>>
>>  let leaf = Leav
>>
>>  or a node:
>>
>>  let node = Node Leaf "msg" Leaf
>>
>>  You can see that Node is a data-constructor that takes 3 values, not
>> type-names as it's parameters.
>>
>>  Hope this helps.
>>
>> On Thu, Feb 26, 2015 at 3:21 PM, Roelof Wobben <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> Suppose we have this definition of a tree :
>>>
>>> data MessageTree = Leaf
>>>                  | Node MessageTree LogMessage MessageTree
>>>   deriving (Show, Eq)
>>>
>>> let Message  = LogMessage "E 1 this is a test error"
>>> let Message = LogMessage "e 2 this is the second test error "
>>>
>>> As I understand it right I can make the first entry like this :
>>> first_entry = Node Messagetree  Message Messagetree
>>>
>>> And the second one like this second_entry = Node Message Messagetree
>>> Message2 Messagetree ??
>>>
>>> Roelof
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>
>>
>>
>> _______________________________________________
>> Beginners mailing 
>> [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
>>
>>
>
>
> _______________________________________________
> Beginners mailing 
> [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
>
>


-- 
Beauty of style and harmony and grace and good rhythm depend on simplicity.
- Plato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150301/04723223/attachment-0001.html>

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

Message: 2
Date: Sun, 1 Mar 2015 14:56:44 +0000
From: emacstheviking <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] trying to install libraries for
        Haskell School of Expression
Message-ID:
        <CAEiEuUJim7h=vyr0hnwolvb_tegyamikrz9uwsjbsgam9b+...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I feel your pain...


> Confession: I abandoned Haskell two years ago because of frustration with
> cabal and hackage. I decided to get back to the language today, and to
> start with Haskell School of Expression. I immediately run into the problem
> that the first thing I try to install with cabal does not work.
>
> It is the same reason I have stopped using it. It's a real shame. Those
with better education and understanding than mine should be concerned that
the uptake of the language is stunted by its package manager.

I love Haskell. I have taught myself (the beginnings at least) of group
theory just to better comprehend the mindset of monads. For that alone I am
glad I learned Haskell as it has rekindled my interest in maths!



> Thanks for any help. Please tell me things are not just as bad now as they
> were when I left ;-)
>
> This mail seems to indicate to me that "cabal hell" is here for some time
to come...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150301/78c4ea3d/attachment-0001.html>

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

Message: 3
Date: Sun, 01 Mar 2015 19:08:22 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] trees on Haskell : Do I understand it
        right ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hello,

Im looking for goofd online software to make the diagrams.
As soon as I find it . I will publish them on the ML.

Roelof

Joel Neely schreef op 1-3-2015 om 14:45:
> Roelof,
>
> Perhaps it would help for you to draw diagrams for the cases you're 
> working.
> If a leaf has nothing below it, and a node always has exactly three 
> things below it (the left child, the message, and the right child),
> what would your picture look like for 1, 2, and 3 nodes?
> And how would you write out constructor expressions that match those 
> shapes?
>
> Hope that helps,
> -jn-
>
>
> On Thu, Feb 26, 2015 at 12:32 PM, Roelof Wobben <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Oke,
>
>     I send it a second time but now in plain text.
>
>     So for 3 it will be like this :
>
>     Node = Node  (Node Leaf "msg1" Leaf) (Node Leaf "msg2") (Node 
>     "msg3" Leaf)  ???
>
>
>     Roelof
>
>
>
>>
>>
>>     Konstantine Rybnikov schreef op 26-2-2015 om 15:08:
>>>     In my second example you can see a minimal node with a message:
>>>
>>>     node = Node Leaf "msg" Leaf
>>>
>>>     Instead of either left or right Leaf you can put another value
>>>     of type MessageTree, for example:
>>>
>>>     node = Node Leaf "msg1" (Node Leaf "msg2" Leaf)
>>>
>>>     On Thu, Feb 26, 2015 at 4:01 PM, Roelof Wobben <[email protected]
>>>     <mailto:[email protected]>> wrote:
>>>
>>>         Oke,
>>>
>>>         So a leaf is a node which has no "branch"
>>>
>>>         I have made a exercise where I have to made the  logMessages.
>>>         Now I have to turn them into a tree
>>>
>>>         Where does the second entry goes then ?
>>>
>>>         Roelof
>>>
>>>
>>>         Konstantine Rybnikov schreef op 26-2-2015 om 14:56:
>>>>         Hi Roelof,
>>>>
>>>>         I think you misunderstood it.
>>>>
>>>>         There are two things here: types and values
>>>>         (value-constructors). They exist in different world, not
>>>>         touching each other.
>>>>
>>>>         In Haskell, you define a type as:
>>>>
>>>>         data <Type_Name> = <ValueConstructor_Name> <Type_Name>
>>>>         <Type_Name> <Type_Name>
>>>>
>>>>         You can create values as:
>>>>
>>>>         let varName = <ValueConstructor_Name> <Value> <Value> <Value>
>>>>
>>>>         You need to put <Value> of some type, not type name itself
>>>>         in place of those <Value>s.
>>>>
>>>>         So, with datatype you provided, you have two data-constructors:
>>>>
>>>>         Leaf
>>>>
>>>>         and
>>>>
>>>>         Node <val> <val> <val>
>>>>
>>>>         You can create a leaf:
>>>>
>>>>         let leaf = Leav
>>>>
>>>>         or a node:
>>>>
>>>>         let node = Node Leaf "msg" Leaf
>>>>
>>>>         You can see that Node is a data-constructor that takes 3
>>>>         values, not type-names as it's parameters.
>>>>
>>>>         Hope this helps.
>>>>
>>>>         On Thu, Feb 26, 2015 at 3:21 PM, Roelof Wobben
>>>>         <[email protected] <mailto:[email protected]>> wrote:
>>>>
>>>>             Hello,
>>>>
>>>>             Suppose we have this definition of a tree :
>>>>
>>>>             data MessageTree = Leaf
>>>>                              | Node MessageTree LogMessage MessageTree
>>>>               deriving (Show, Eq)
>>>>
>>>>             let Message  = LogMessage "E 1 this is a test error"
>>>>             let Message = LogMessage "e 2 this is the second test
>>>>             error "
>>>>
>>>>             As I understand it right I can make the first entry
>>>>             like this : first_entry = Node Messagetree  Message
>>>>             Messagetree
>>>>
>>>>             And the second one like this second_entry = Node
>>>>             Message Messagetree Message2 Messagetree ??
>>>>
>>>>             Roelof
>>>>
>>>>             _______________________________________________
>>>>             Beginners mailing list
>>>>             [email protected] <mailto:[email protected]>
>>>>             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
>>>
>>>
>>>         _______________________________________________
>>>         Beginners mailing list
>>>         [email protected] <mailto:[email protected]>
>>>         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
>>
>
>
>     _______________________________________________
>     Beginners mailing list
>     [email protected] <mailto:[email protected]>
>     http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
>
>
> -- 
> Beauty of style and harmony and grace and good rhythm depend on 
> simplicity. - Plato
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 81, Issue 3
****************************************

Reply via email to