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:  garbage collected object (Norbert Melzer)
   2. Re:  garbage collected object (Ryan Trinkle)
   3.  Error while trying to install ByteString Package
      (Abhinav Kalawatia)
   4.  help with IO guards (Miro Karpis)


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

Message: 1
Date: Wed, 14 Jan 2015 13:12:11 +0100
From: Norbert Melzer <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] garbage collected object
Message-ID:
        <CA+bCVssYW4fQbp2DrHu05_Q64aPy40xuXGd5t-virUog=ox...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

If you know enough about an object to find it on the heap, then you hold a
reference, if you hold a reference, then it's probably not gced...
Am 14.01.2015 11:24 schrieb "Elise Huard" <[email protected]>:

> Hi,
>
> Maybe a stupid question: is there a way to check whether a particular
> data structure (or set of data structures) has been garbage collected?
> Or indirectly: is there a way to check what's still alive in the heap,
> so that you can potentially diff from one moment to another?
> Thanks,
>
> Elise Huard
> _______________________________________________
> 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/20150114/e553048c/attachment-0001.html>

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

Message: 2
Date: Wed, 14 Jan 2015 07:17:33 -0500
From: Ryan Trinkle <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] garbage collected object
Message-ID:
        <cahnepiz121nlwefm6jffoq-qqro8qwxzk+ndsjwk0tvu-y3...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

You can use the 'vacuum' package to explore the heap, and you can use
System.Mem.Weak to create a reference to something that won't keep it from
being GCed and will let you check on it later.  You can also use the
built-in heap profiling capabilities to track things like the memory usage
of the entire heap from moment to moment.

On Wed, Jan 14, 2015 at 5:24 AM, Elise Huard <[email protected]> wrote:

> Hi,
>
> Maybe a stupid question: is there a way to check whether a particular
> data structure (or set of data structures) has been garbage collected?
> Or indirectly: is there a way to check what's still alive in the heap,
> so that you can potentially diff from one moment to another?
> Thanks,
>
> Elise Huard
> _______________________________________________
> 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/20150114/03d7376f/attachment-0001.html>

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

Message: 3
Date: Wed, 14 Jan 2015 12:54:34 +0000 (UTC)
From: Abhinav Kalawatia <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [Haskell-beginners] Error while trying to install ByteString
        Package
Message-ID:
        
<1496218722.1011416.1421240074267.javamail.ya...@jws10604.mail.bf1.yahoo.com>
        
Content-Type: text/plain; charset="utf-8"

Hi,?I get the following error while I tried installing the ByteString package. 
Could you please help me resolve 
this?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
C:\Users> cabal install bytestring
Resolving dependencies...
Configuring bytestring-0.10.4.1...
Failed to install bytestring-0.10.4.1
Last 10 lines of the build log ( C:\Users\AppData\Roaming\caba
l\logs\bytestring-0.10.4.1.log ):
setup-Cabal-1.18.1.3-i386-windows-ghc-7.8.3.exe: Missing dependency on a
foreign library:
* Missing (or bad) header file: fpstring.h
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
cabal: Error: some packages failed to install:
bytestring-0.10.4.1 failed during the configure step. The exception was:
ExitFailure 
1>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>?Regards,Abhinav?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20150114/5aaee574/attachment-0001.html>

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

Message: 4
Date: Thu, 15 Jan 2015 12:51:37 +0100
From: Miro Karpis <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] help with IO guards
Message-ID:
        <cajnnbxfoypxd2d53u__vvlhcbbleqj1pqbdcovq9ynder6h...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi,

please is there a way to have guards with 'where' that communicates with
IO? Or is there some other more elegant way? I can do this with classic
if/else,...but I just find it nicer with guards.


I have something like this (just an example):


f :: Int -> IO String
f x
    | null dbOutput = return "no db record"
    | otherwise = return "we got some db records"
    where dbOutput = getDBRecord x


getDBRecord :: Int -> IO [Int]
getDBRecord recordId = do
    putStrLn $ "checking dbRecord" ++ show recordId
    --getting data from DB
    return [1,2]


problem is that db dbOutput is IO and the guard check does not like it:

Couldn't match expected type ?[a0]? with actual type ?IO [Int]?
    In the first argument of ?null?, namely ?dbOutput?
    In the expression: null dbOutput



Cheers,
Miro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20150115/79289d65/attachment-0001.html>

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

Subject: Digest Footer

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


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

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

Reply via email to