Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/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:  [web-devel] yesod dependency hell (Michael Litchard)
   2. Re:  [web-devel] yesod dependency hell (Michael Litchard)
   3.  How to avoid evaluating the second (undefined) argument of a
      Boolean AND operation? (Costello, Roger L.)
   4. Re:  How to avoid evaluating the second   (undefined) argument
      of a Boolean AND operation? (Jack Henahan)


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

Message: 1
Date: Wed, 22 Jun 2011 14:52:05 -0700
From: Michael Litchard <[email protected]>
Subject: Re: [Haskell-beginners] [web-devel] yesod dependency hell
To: Thomas Hartman <[email protected]>
Cc: [email protected], web-devel <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Thomas,
             I tried what you suggested and I still have the exact same problem.

On Wed, Jun 22, 2011 at 1:50 PM, Michael Litchard <[email protected]> wrote:
> My thinking is that this problem comes up anytime someone wants to
> play around with experimental code. As evidenced by the
> yesodwiki.cabal file, I think there's a more straightforward solution.
> I'm just not seeing it.
>
> On Wed, Jun 22, 2011 at 1:46 PM, Thomas Hartman
> <[email protected]> wrote:
>> one idea: move .ghc and .cabal to temp directory.
>>
>> start over with a clean slate.
>>
>> On Wed, Jun 22, 2011 at 1:30 PM, Michael Litchard <[email protected]> 
>> wrote:
>>> Configuring Aframe-0.0.1...
>>> Warning: This package indirectly depends on multiple versions of the same
>>> package. This is highly likely to cause a compile failure.
>>> package yesod-auth-0.4.0.2 requires yesod-form-0.1.0.1
>>> package yesod-0.8.2.1 requires yesod-form-0.1.0.1
>>> package Aframe-0.0.1 requires yesod-form-0.2.0
>>>
>>> I specified in Aframe.cabal yesod-form 0.2.0. The above warning is
>>> what I was looking to avoid. What is the solution to this problem? I
>>> could not find an obvious solution in yesodwiki.cabal, even though I
>>> see it's doing something similar to what I want. How did you deal with
>>> the above warning message?
>>>
>>> On Wed, Jun 22, 2011 at 12:32 PM, Michael Snoyman <[email protected]> 
>>> wrote:
>>>> Have a look at the yesodwiki[1]; basically, you can't use the yesod
>>>> package itself, only the subpackages. This is by design so that a
>>>> single Yesod release will keep API stability, while users can still
>>>> experiment with newer versions of underlying packages.
>>>>
>>>> Michael
>>>>
>>>> [1] https://github.com/snoyberg/yesodwiki/blob/master/yesodwiki.cabal
>>>>
>>>> On Wed, Jun 22, 2011 at 10:29 PM, Michael Litchard <[email protected]> 
>>>> wrote:
>>>>> I need to use yesod-form 0.2.0. The problem is that the yesod package,
>>>>> and the yesod-auth package expect yesod-form to be 0.1.0*
>>>>> I tried changing the .cabal files but that breaks in ways that makes
>>>>> me think the fix is not so simple. How do I go about being able to use
>>>>> yesod-form 0.2.0
>>>>>
>>>>> _______________________________________________
>>>>> web-devel mailing list
>>>>> [email protected]
>>>>> http://www.haskell.org/mailman/listinfo/web-devel
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> web-devel mailing list
>>> [email protected]
>>> http://www.haskell.org/mailman/listinfo/web-devel
>>>
>>
>



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

Message: 2
Date: Wed, 22 Jun 2011 15:19:45 -0700
From: Michael Litchard <[email protected]>
Subject: Re: [Haskell-beginners] [web-devel] yesod dependency hell
To: Thomas Hartman <[email protected]>
Cc: [email protected], web-devel <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

The solution seems to be to remove yesod from the build-depends
section. I'm having other problems, don't think it's related.

On Wed, Jun 22, 2011 at 2:52 PM, Michael Litchard <[email protected]> wrote:
> Thomas,
> ? ? ? ? ? ? I tried what you suggested and I still have the exact same 
> problem.
>
> On Wed, Jun 22, 2011 at 1:50 PM, Michael Litchard <[email protected]> wrote:
>> My thinking is that this problem comes up anytime someone wants to
>> play around with experimental code. As evidenced by the
>> yesodwiki.cabal file, I think there's a more straightforward solution.
>> I'm just not seeing it.
>>
>> On Wed, Jun 22, 2011 at 1:46 PM, Thomas Hartman
>> <[email protected]> wrote:
>>> one idea: move .ghc and .cabal to temp directory.
>>>
>>> start over with a clean slate.
>>>
>>> On Wed, Jun 22, 2011 at 1:30 PM, Michael Litchard <[email protected]> 
>>> wrote:
>>>> Configuring Aframe-0.0.1...
>>>> Warning: This package indirectly depends on multiple versions of the same
>>>> package. This is highly likely to cause a compile failure.
>>>> package yesod-auth-0.4.0.2 requires yesod-form-0.1.0.1
>>>> package yesod-0.8.2.1 requires yesod-form-0.1.0.1
>>>> package Aframe-0.0.1 requires yesod-form-0.2.0
>>>>
>>>> I specified in Aframe.cabal yesod-form 0.2.0. The above warning is
>>>> what I was looking to avoid. What is the solution to this problem? I
>>>> could not find an obvious solution in yesodwiki.cabal, even though I
>>>> see it's doing something similar to what I want. How did you deal with
>>>> the above warning message?
>>>>
>>>> On Wed, Jun 22, 2011 at 12:32 PM, Michael Snoyman <[email protected]> 
>>>> wrote:
>>>>> Have a look at the yesodwiki[1]; basically, you can't use the yesod
>>>>> package itself, only the subpackages. This is by design so that a
>>>>> single Yesod release will keep API stability, while users can still
>>>>> experiment with newer versions of underlying packages.
>>>>>
>>>>> Michael
>>>>>
>>>>> [1] https://github.com/snoyberg/yesodwiki/blob/master/yesodwiki.cabal
>>>>>
>>>>> On Wed, Jun 22, 2011 at 10:29 PM, Michael Litchard <[email protected]> 
>>>>> wrote:
>>>>>> I need to use yesod-form 0.2.0. The problem is that the yesod package,
>>>>>> and the yesod-auth package expect yesod-form to be 0.1.0*
>>>>>> I tried changing the .cabal files but that breaks in ways that makes
>>>>>> me think the fix is not so simple. How do I go about being able to use
>>>>>> yesod-form 0.2.0
>>>>>>
>>>>>> _______________________________________________
>>>>>> web-devel mailing list
>>>>>> [email protected]
>>>>>> http://www.haskell.org/mailman/listinfo/web-devel
>>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> web-devel mailing list
>>>> [email protected]
>>>> http://www.haskell.org/mailman/listinfo/web-devel
>>>>
>>>
>>
>



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

Message: 3
Date: Wed, 22 Jun 2011 19:03:17 -0400
From: "Costello, Roger L." <[email protected]>
Subject: [Haskell-beginners] How to avoid evaluating the second
        (undefined) argument of a Boolean AND operation?
To: "[email protected]" <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Folks,

Here is my own version of the Bool datatype, and my own version of the Boolean 
AND:

data MyBool = F | T

myAND :: MyBool -> MyBool -> MyBool
myAND F x = F
myAND T x = x

If the first argument is F then return F. I assumed that the second argument 
would not even bother being evaluated.

I figured that I could provide an undefined value for the second argument:

     myAND F (1 / 0) 

However, that doesn't work. I get this error message:

    No instance for (Fractional MyBool)
      arising from a use of `/' 
    Possible fix: add an instance declaration for (Fractional MyBool)
    In the second argument of `myAND', namely `(1 / 0)'
    In the expression: myAND F (1 / 0)
    In the definition of `t4': t4 = myAND F (1 / 0)

Why does it evaluate the second argument when the answer is already known from 
the first argument? 

How can I design it so that if the answer is known from the first argument, 
then an undefined second argument doesn't produce an error?

/Roger



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

Message: 4
Date: Wed, 22 Jun 2011 19:07:45 -0400
From: Jack Henahan <[email protected]>
Subject: Re: [Haskell-beginners] How to avoid evaluating the second
        (undefined) argument of a Boolean AND operation?
To: "Costello, Roger L." <[email protected]>
Cc: Haskell Beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Use

    myAND F _ = F

instead of using x.

On Jun 22, 2011, at 7:03 PM, Costello, Roger L. wrote:

> Hi Folks,
> 
> Here is my own version of the Bool datatype, and my own version of the 
> Boolean AND:
> 
> data MyBool = F | T
> 
> myAND :: MyBool -> MyBool -> MyBool
> myAND F x = F
> myAND T x = x
> 
> If the first argument is F then return F. I assumed that the second argument 
> would not even bother being evaluated.
> 
> I figured that I could provide an undefined value for the second argument:
> 
>     myAND F (1 / 0) 
> 
> However, that doesn't work. I get this error message:
> 
>    No instance for (Fractional MyBool)
>      arising from a use of `/' 
>    Possible fix: add an instance declaration for (Fractional MyBool)
>    In the second argument of `myAND', namely `(1 / 0)'
>    In the expression: myAND F (1 / 0)
>    In the definition of `t4': t4 = myAND F (1 / 0)
> 
> Why does it evaluate the second argument when the answer is already known 
> from the first argument? 
> 
> How can I design it so that if the answer is known from the first argument, 
> then an undefined second argument doesn't produce an error?
> 
> /Roger
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 398E692F.asc
Type: application/x-apple-msg-attachment
Size: 24295 bytes
Desc: not available
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110622/35b94187/attachment.bin>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 881 bytes
Desc: This is a digitally signed message part
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110622/35b94187/attachment.pgp>

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

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 36, Issue 55
*****************************************

Reply via email to