Re: [Haskell-beginners] Beginners Digest, Vol 108, Issue 12

发自我的 iPad
在 2017年6月24日,20:00,beginners-request@haskell.org 写道:
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-request@haskell.org
You can reach the person managing the list at beginners-owner@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: help designing types for a gsl fit (David McBride) 2. What to use when you need random values? (Silent Leaf) 3. Re: What to use when you need random values? (David McBride)
----------------------------------------------------------------------
Message: 1 Date: Fri, 23 Jun 2017 09:58:35 -0400 From: David McBride
To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell Subject: Re: [Haskell-beginners] help designing types for a gsl fit Message-ID: Content-Type: text/plain; charset="UTF-8" If you look at the type of labelNew
GlibString string => Maybe string -> IO Label
If you look at the instances for GlibString, they could be Text or [Char]. You have to decide which. The fact that you are using Nothing does not tell you the entire final type. It could be Maybe [Char], or Maybe Text. Even though the choice seems arbitrary in this instance, you have to decide which it is. So try this.
lprog <- G.labelNew (Nothing :: Maybe [Char])
On Fri, Jun 23, 2017 at 3:22 AM, Agustin Larreinegabe
wrote: Hello, I'm trying to install an application Termite - Debug but I get this error in line 929:14
when it try to do this
lprog <- G.labelNew Nothing
The error says:
Could not deduce (glib-0.13.4.1:System.Glib.UTFString.GlibString string0) arising from a use of ‘G.labelNew’ from the context (D.Rel c v a s) bound by the type signature for sourceWindowCreate :: D.Rel c v a s => RSourceView c a u -> IO G.Widget at Debug/SourceView.hs:913:23-73 instance glib-0.13.4.1:System.Glib.UTFString.GlibString [Char] -- Defined in ‘glib-0.13.4.1:System.Glib.UTFString’ In a stmt of a 'do' block: lprog <- G.labelNew Nothing In the expression: do { vbox <- G.vBoxNew False 0; G.widgetShow vbox; spec <- getIORef svInputSpec ref; code <- codeWinNew spec; .... } In an equation for ‘sourceWindowCreate’: sourceWindowCreate ref = do { vbox <- G.vBoxNew False 0; G.widgetShow vbox; spec <- getIORef svInputSpec ref; cabal: Error: some packages failed to install:
I really don't know how to proceed, I'm new with Haskell
Thanks in advance.
----------------- Agustin Larreinegabe
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
Message: 2 Date: Fri, 23 Jun 2017 16:24:07 +0200 From: Silent Leaf
To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell Subject: [Haskell-beginners] What to use when you need random values? Message-ID: Content-Type: text/plain; charset="utf-8" Hi, I've had trouble finding the best way(s) to use random values in haskell, as it seems like there are several modules that either do the same thing or reuse one another i'm not sure.
There is System.Random - is it better to use the streams random(R)s or a more imperative randomRIO? - is it better to use mkStdGen or newStdGen or getStdGen? There is Test.QuickCheck and its type(class?) Gen There is a module in Control.Monad (i think) which exports the type Rnd
What about performances, and all those options? What do you like to use with random numbers?
I know that's a lot of questions. feel free to only answer to a few of them. :)
participants (1)
-
Ning Yin