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:  Compiler can't deduce Bool as instance of    ToField
      (Oliver Charles)
   2. Re:  Heterogeneous Lists (Giacomo Tesio)
   3.  Trouble with layout in wxHaskell (Nathan H?sken)
   4. Re:  print [] (Michael Peternell)
   5. Re:  How Haskell Fits Into an Operating System / API
      Environment (Kelleher, Kevin)
   6. Re:  Trouble with layout in wxHaskell (Nathan H?sken)


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

Message: 1
Date: Wed, 14 Aug 2013 13:16:49 +0100
From: Oliver Charles <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Compiler can't deduce Bool as
        instance of     ToField
Message-ID:
        <CAGRp5RkKNk+8PfgESppM2cvM9E_7Zr8+MhXX=wobboldxke...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

You have declared that foo is *any* type that has a ToField instance,
allowing the caller of foo to determine the type at their will. However,
your implementation of foo is more specific and requires a is actually Bool
and nothing else.
On 14 Aug 2013 10:24, "Bryan Vicknair" <[email protected]> wrote:

> postgresql-simple declares Bool as an instance of the ToField class.  The
> compiler can't deduce that given this simple code however:
>
>   import Database.PostgreSQL.Simple.ToField (ToField(..))
>
>   foo :: (ToField a) => a
>   foo = True
>
>
> It fails with this error:
>
>   Db.hs:64:7:
>       Could not deduce (a ~ Bool)
>       from the context (ToField a)
>         bound by the type signature for foo :: ToField a => a
>         at Db.hs:63:8-23
>         `a' is a rigid type variable bound by
>             the type signature for foo :: ToField a => a at Db.hs:63:8
>       In the expression: True
>       In an equation for `foo': foo = True
>   Failed, modules loaded: none.
>
> What am I missing?
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130814/ea16a81e/attachment-0001.html>

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

Message: 2
Date: Wed, 14 Aug 2013 15:21:13 +0200
From: Giacomo Tesio <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>,
        [email protected]
Subject: Re: [Haskell-beginners] Heterogeneous Lists
Message-ID:
        <cahl7psex9yst6ueglay_9f8jyltxi1d8ud0ujpsug9u43ps...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

> > I recently ran into this with a GUI application, where I needed to
> > process a list of widgets that were members of the same typeclass, but
> > I had to wrap them all because they were different types.
>
> Your misconception is likely that you need to /store/ widgets, because
> you think in terms of memory.  What you really need is /definitions/ of
> widgets, which can very well have different types.  Then you can combine
> them using the usual monadic or applicative interface.
>
>
Ertugrul, can you please expand on this?


Giacomo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130814/dc98d787/attachment-0001.html>

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

Message: 3
Date: Wed, 14 Aug 2013 17:03:48 +0200
From: Nathan H?sken <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Trouble with layout in wxHaskell
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hey,

I am trying to understand how do a layout in wxHaskell. I am trying to 
make a frame with 2 text entries. One single lined at the top and one 
multiline below it. Both should expand with the window size horizontal. 
When the window is expanded vertical, only the multiline text entry 
should expand.

Her is what I wrote:

   main = start mainFrame

   mainFrame = do
     f        <- frame [text := "BiVision"]
     buffer   <- textEntry f []
     mainArea <- textCtrl  f []
     set f [layout := expand $ column 2 [hstretch $ widget buffer, 
stretch $ widget mainArea]]

This gives me a window with the desired controls. But they are not 
expanding.
Why?
I tried different combinations of expand and stretch (I do not really 
understand the difference?). But nothing works.

I am guessing there is something simple I do not yet understand :).

Thanks for any help!
Nathan



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

Message: 4
Date: Wed, 14 Aug 2013 20:30:01 +0200
From: Michael Peternell <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] print []
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

There is a way. It's

print "[]"

if the compiler cannot infer the type of an empty list, it's because you wrote 
a literal empty list [].

Sorry for giving such a practical (non-theoretical) answer ;)

Michael




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

Message: 5
Date: Wed, 14 Aug 2013 19:04:43 +0000
From: "Kelleher, Kevin" <[email protected]>
To: "The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell" <[email protected]>
Subject: Re: [Haskell-beginners] How Haskell Fits Into an Operating
        System / API Environment
Message-ID:
        <644E83C9A0C2C54A9F40341B5F63393716B8E184@CAMBOSEXC06.camelot.local>
Content-Type: text/plain; charset="us-ascii"

I have had the same frustration. It feels like you're learning a foreign 
language
that doesn't have any vocabulary for walking directions, prices, or ordering 
food.
So, while you could discuss philosophy, say, you wouldn't be able to ask for a
drink of water, or how to find the bathroom.

I do believe there is a payoff to studying Haskell, and I do keep plugging away,
rather inconstantly.  It's difficult, because I don't really have the time now,
but hopefully I can devote some of an upcoming vacation to make what I
know of Haskell finally touch the ground.

Kevin

From: Beginners [mailto:[email protected]] On Behalf Of Stephen 
Tetley
Sent: Sunday, August 11, 2013 11:45 AM
To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level 
topics related to Haskell
Subject: Re: [Haskell-beginners] How Haskell Fits Into an Operating System / 
API Environment

I tend to see OO subtyping and heterogeneous collections as more an impediment 
to (pure) functional integration with the "rest-of-the-world" than state. There 
are a lot of quality wrappers to stateful C libraries from Haskell, but few to 
object oriented C++ or Objective C libraries.

On 11 August 2013 16:10, Philippe Sismondi 
<[email protected]<mailto:[email protected]>> wrote:


As a result of this little thread I have come to another conclusion, and this 
is just my subjective view. Most of the software that I am interested in seems 
to live most comfortably with a stateful conception of the world. (The native 
libraries I find most useful certainly are stateful.) I am reasonably competent 
with monads and monad transformers in Haskell. But, to be honest, after three 
years of pluggin away at Haskell, I am not the least convinced that the problem 
of handling a changing external world in a pure functional language has been 
successfully solved by those techniques. I always feel as though I am using the 
robot arm on a space shuttle when a screwdriver would do. (Again, no need to 
rebut this - I may be wrong or just to stupid to use Haskell effectively - so 
be it.)

Perhaps in the end I do not really believe that functional programming is the 
panacea that its devotees claim it to be.

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this message
immediately if this is an electronic communication.

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130814/20a3ff4c/attachment-0001.html>

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

Message: 6
Date: Thu, 15 Aug 2013 13:56:25 +0200
From: Nathan H?sken <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Trouble with layout in wxHaskell
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Ok, I need to use fill und hfill.
I personally think the documentation is little confusing, but I will 
take this to the developers.

Regards,
Nathan

On 08/14/2013 05:03 PM, Nathan H?sken wrote:
> Hey,
>
> I am trying to understand how do a layout in wxHaskell. I am trying to 
> make a frame with 2 text entries. One single lined at the top and one 
> multiline below it. Both should expand with the window size 
> horizontal. When the window is expanded vertical, only the multiline 
> text entry should expand.
>
> Her is what I wrote:
>
>   main = start mainFrame
>
>   mainFrame = do
>     f        <- frame [text := "BiVision"]
>     buffer   <- textEntry f []
>     mainArea <- textCtrl  f []
>     set f [layout := expand $ column 2 [hstretch $ widget buffer, 
> stretch $ widget mainArea]]
>
> This gives me a window with the desired controls. But they are not 
> expanding.
> Why?
> I tried different combinations of expand and stretch (I do not really 
> understand the difference?). But nothing works.
>
> I am guessing there is something simple I do not yet understand :).
>
> Thanks for any help!
> Nathan
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners




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

Subject: Digest Footer

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


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

End of Beginners Digest, Vol 62, Issue 16
*****************************************

Reply via email to