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.  How does one uninstall a Hackage package? :) (KC)
   2. Re:  How does one uninstall a Hackage package? :)
      (Christopher Done)
   3. Re:  How does one uninstall a Hackage package? :)
      (Ertugrul Soeylemez)
   4. Re:  Quickcheck Preconditions (Jonas Almstr?m Dureg?rd)
   5. Re:  Quickcheck Preconditions (Guy)
   6. Re:  Quickcheck Preconditions (Jonas Almstr?m Dureg?rd)
   7.  How to avoid repeating code (Federico Mastellone)
   8.  Large binary overhead? (Christopher Howard)
   9. Re:  Large binary overhead? (Erik de Castro Lopo)


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

Message: 1
Date: Wed, 25 May 2011 06:16:32 -0700
From: KC <[email protected]>
Subject: [Haskell-beginners] How does one uninstall a Hackage package?
        :)
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

-- 
--
Regards,
KC



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

Message: 2
Date: Wed, 25 May 2011 15:29:34 +0200
From: Christopher Done <[email protected]>
Subject: Re: [Haskell-beginners] How does one uninstall a Hackage
        package? :)
To: KC <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

For libraries, to merely unregister it:

ghc-pkg unregister the-package-name

For executables and static files that were installed, there is no
method, it has to be done manually.



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

Message: 3
Date: Wed, 25 May 2011 15:39:41 +0200
From: Ertugrul Soeylemez <[email protected]>
Subject: Re: [Haskell-beginners] How does one uninstall a Hackage
        package? :)
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Hello KC,

short answer: you don't.  Usually there is no reason to uninstall
packages other than to free some disk space.  If installed packages get
in your way, then it's mostly because of messed up dependencies in other
packages.


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/





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

Message: 4
Date: Wed, 25 May 2011 17:42:53 +0200
From: Jonas Almstr?m Dureg?rd <[email protected]>
Subject: Re: [Haskell-beginners] Quickcheck Preconditions
To: Guy <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Not sure what you mean by "specifying bounds for quickcheck".


2011/5/25 Guy <[email protected]>:
> Thanks, mod is a neat trick for applying the size. Is there a simple way of 
> specifying bounds for quickcheck, or would I have to write a custom generator 
> to do that?
>
>
>>________________________________
>>From: Jonas Almstr?m Dureg?rd <[email protected]>
>>Sent: Wednesday, 25 May 2011, 14:09
>>Subject: Re: [Haskell-beginners] Quickcheck Preconditions
>>
>>
>>You can write your own generators and use the forall function. Or for these 
>>simple examples you can just test on wrappers:
>>
>>
>>testFoo :: (a,a,a,[a]) -> IO Bool
>>testFoo (a1,a2,a3,as) = foo (a1:a2:a3:as)
>>
>>
>>testBar :: (a,[a]) -> Int -> IO ()
>>testBar (x,xs) n = bar xs' (n `mod` length xs') where?xs' = x:xs
>>
>>
>>/J
>



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

Message: 5
Date: Wed, 25 May 2011 19:13:44 +0300
From: Guy <[email protected]>
Subject: Re: [Haskell-beginners] Quickcheck Preconditions
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Simply stating that I need an integer between X and Y

On 25/05/2011 18:42, Jonas Almstr?m Dureg?rd wrote:
> Not sure what you mean by "specifying bounds for quickcheck".
>
>
> 2011/5/25 Guy<[email protected]>:
>> Thanks, mod is a neat trick for applying the size. Is there a simple way of 
>> specifying bounds for quickcheck, or would I have to write a custom 
>> generator to do that?
>>
>>
>>> ________________________________
>>> From: Jonas Almstr?m Dureg?rd<[email protected]>
>>> Sent: Wednesday, 25 May 2011, 14:09
>>> Subject: Re: [Haskell-beginners] Quickcheck Preconditions
>>>
>>>
>>> You can write your own generators and use the forall function. Or for these 
>>> simple examples you can just test on wrappers:
>>>
>>>
>>> testFoo :: (a,a,a,[a]) ->  IO Bool
>>> testFoo (a1,a2,a3,as) = foo (a1:a2:a3:as)
>>>
>>>
>>> testBar :: (a,[a]) ->  Int ->  IO ()
>>> testBar (x,xs) n = bar xs' (n `mod` length xs') where xs' = x:xs
>>>
>>>
>>> /J




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

Message: 6
Date: Wed, 25 May 2011 21:27:52 +0200
From: Jonas Almstr?m Dureg?rd <[email protected]>
Subject: Re: [Haskell-beginners] Quickcheck Preconditions
To: Guy <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

abs $ (n `mod` (y - x)) + x

Provided y > x >= 0.

/J

On 25 May 2011 18:13, Guy <[email protected]> wrote:

> Simply stating that I need an integer between X and Y
>
>
> On 25/05/2011 18:42, Jonas Almstr?m Dureg?rd wrote:
>
>> Not sure what you mean by "specifying bounds for quickcheck".
>>
>>
>> 2011/5/25 Guy<[email protected]>:
>>
>>> Thanks, mod is a neat trick for applying the size. Is there a simple way
>>> of specifying bounds for quickcheck, or would I have to write a custom
>>> generator to do that?
>>>
>>>
>>>  ________________________________
>>>> From: Jonas Almstr?m Dureg?rd<[email protected]>
>>>> Sent: Wednesday, 25 May 2011, 14:09
>>>> Subject: Re: [Haskell-beginners] Quickcheck Preconditions
>>>>
>>>>
>>>> You can write your own generators and use the forall function. Or for
>>>> these simple examples you can just test on wrappers:
>>>>
>>>>
>>>> testFoo :: (a,a,a,[a]) ->  IO Bool
>>>> testFoo (a1,a2,a3,as) = foo (a1:a2:a3:as)
>>>>
>>>>
>>>> testBar :: (a,[a]) ->  Int ->  IO ()
>>>> testBar (x,xs) n = bar xs' (n `mod` length xs') where xs' = x:xs
>>>>
>>>>
>>>> /J
>>>>
>>>
>
> _______________________________________________
> 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/20110525/490b67bc/attachment-0001.htm>

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

Message: 7
Date: Wed, 25 May 2011 21:23:06 -0300
From: Federico Mastellone <[email protected]>
Subject: [Haskell-beginners] How to avoid repeating code
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I created a Data.MultiMap module based on Data.Map and Data.Set like this:

data MultiMap k v = MultiMap (Map k (Set v))

and a Data.IntMultiMap module based on Data.IntMap and data.IntSet like
this:

data IntMultiMap = IntMultiMap (IntMap IntSet)

For example the functions to add a value I wrote are:

For MultiMap:
addValue :: k -> v -> MultiMap k v -> MultiMap k v
addValue k v (MultiMap m) = MultiMap $ Map.insertWith (\new old ->
Set.insert v old) k (Set.singleton v) m

For IntMultiMap:
addValue :: Int -> Int -> IntMultiMap -> IntMultiMap
addValue k v (IntMultiMap m) = IntMultiMap $ IntMap.insertWith (\new old ->
IntSet.insert v old) k (IntSet.singleton v) m

Both modules look almost the same, with the same
documentation, same behavior, same function names but with different type
signatures.

Is there a way to make this simpler?

The same thing happens to the modules that are using MultiMap and
IntMultiMap, I have to write two versions of each.

Thanks!

-- 
Federico Mastellone
Computer Science Engineer - ITBA

".. there are two ways of constructing a software design: One way is to make
it so simple that there are obviously no deficiencies, and the other way is
to make it so complicated that there are no obvious deficiencies. The first
method is far more difficult."

Tony Hoare, 1980 ACM Turing Award Lecture.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110525/67e83a62/attachment-0001.htm>

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

Message: 8
Date: Wed, 25 May 2011 19:42:11 -0800
From: Christopher Howard <[email protected]>
Subject: [Haskell-beginners] Large binary overhead?
To: Haskell Beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

I'm still going through the GHC tutorial, so be patient with me: But why
is it that my GHC-produced executables are always so large? Even my one
line Hello World program ends up being over 500KB. I thought maybe it
was because all of the functionality was statically compiled in, but I
used ldd and saw that my hello world binary links dynamically to 10
different C libraries. (I compile on Gentoo Linux x86, if that makes a
difference.)

Anyway, is that just the way it is, or does this become a non-issue once
I learn proper optimization/linking techniques?

-- 
frigidcode.com
theologia.indicium.us



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

Message: 9
Date: Thu, 26 May 2011 14:02:58 +1000
From: Erik de Castro Lopo <[email protected]>
Subject: Re: [Haskell-beginners] Large binary overhead?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Christopher Howard wrote:

> I'm still going through the GHC tutorial, so be patient with me: But why
> is it that my GHC-produced executables are always so large? Even my one
> line Hello World program ends up being over 500KB. I thought maybe it
> was because all of the functionality was statically compiled in, but I
> used ldd and saw that my hello world binary links dynamically to 10
> different C libraries.

Its that size because the Haskell libraries are statically linked
into your program.

See this SO question/answer:

   
http://stackoverflow.com/questions/6115459/small-haskell-program-compiled-with-ghc-into-huge-binary

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



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

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


End of Beginners Digest, Vol 35, Issue 49
*****************************************

Reply via email to