Re: [Haskell-cafe] Maintaining lambdabot

2013-03-14 Thread Jason Dagit
On Wed, Feb 20, 2013 at 11:19 AM, Gwern Branwen  wrote:

> On Wed, Feb 20, 2013 at 1:35 PM, Jan Stolarek 
> wrote:
> > Gwern, and what do you think about James' fork of lambdabot? It seems
> that there was a lot of work
> > put into it and that this is indeed a good starting point to continue
> development.
>
> I haven't looked at the diffs; if as he says the security around the
> evaluation has been weakened, that's a deal-breaker until it's fixed.
> lambdabot can't be insecure since it will be run in a public IRC.
>

I absolutely agree. There are sandboxing things we can do around the
lambdabot instance, but Haskell has a lot of opportunities for statically
disallowing questionable things. I would like to start our defense there
and add layers around that.

My real reason for reviving this thread: Can I get a status update, please?

Thanks,
Jason
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANNOUNCE: Win32-services

2013-03-14 Thread Michael Steele
I uploaded a new packaged named Win32-services. This library is a partial
binding to the Win32 System Services API. It's now easier to write Windows
service applications in Haskell.

The hackage page  [1]
demonstrates simple usage. There are also 2 examples included with the
sources. One is a translation of Microsoft's official example.

[1]: http://hackage.haskell.org/package/Win32-services

-- Michael Steele
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Where's the case? or The difference between simpl and prep

2013-03-14 Thread Tom Ellis
On Thu, Mar 14, 2013 at 10:43:14PM +, Simon Peyton-Jones wrote:
> |  -Original Message-
> |  From: Tom Ellis
> |  The -ddump-simpl output below doesn't contain a case corresponding to the
> |  seq in sum', but the -ddump-prep does.  Isn't the output from simpl the
> |  input to prep?  If so, where does the case reappear from?  If not, how are
> |  simpl and prep related?
> |  
> |  It seems to have something to do with "Str=DmdType SS" but I don't
> |  understand.  This seems to come from the IdInfo on the Id which is the
> |  binder "Test.sum'" but [1] says that this information is optional so it
> |  seems strange that such crucial information would be encoded there.
>
> Check out 
> http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/HscMain
> and the notes at the top of
>http://darcs.haskell.org/ghc/compiler/coreSyn/CorePrep.lhs

Thanks Simon.  That's lovely code and easy to read.

I see that the decision between let and case is made based on the
idDemandInfo which specifies whether a value is wanted strictly or not.

I presume that the explicit case is removed in the Simpl phase because it is
easier for optimisations to work on the Demand value than explicit case
statements.

Tom

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Where's the case? or The difference between simpl and prep

2013-03-14 Thread Simon Peyton-Jones
Check out 
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/HscMain
and the notes at the top of
 http://darcs.haskell.org/ghc/compiler/coreSyn/CorePrep.lhs

Beyond that I'm happy to help

Simon

|  -Original Message-
|  From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-
|  boun...@haskell.org] On Behalf Of Tom Ellis
|  Sent: 14 March 2013 20:05
|  To: Haskell Cafe
|  Subject: [Haskell-cafe] Where's the case? or The difference between simpl and
|  prep
|  
|  The -ddump-simpl output below doesn't contain a case corresponding to the
|  seq in sum', but the -ddump-prep does.  Isn't the output from simpl the
|  input to prep?  If so, where does the case reappear from?  If not, how are
|  simpl and prep related?
|  
|  It seems to have something to do with "Str=DmdType SS" but I don't
|  understand.  This seems to come from the IdInfo on the Id which is the
|  binder "Test.sum'" but [1] says that this information is optional so it
|  seems strange that such crucial information would be encoded there.
|  
|  Thanks,
|  
|  Tom
|  
|  [1] http://www.haskell.org/ghc/docs/7.6.2/html/libraries/ghc-
|  7.6.2/IdInfo.html#t:IdInfo
|  
|  
|  % cat Test.hs
|  module Test where
|  
|  sum' :: [Integer] -> Integer -> Integer
|  sum' [] n = n
|  sum' (x:xs) n = n `seq` sum' xs (n + x)
|  % ghc -fforce-recomp -ddump-simpl -O2 Test.hs
|  [1 of 1] Compiling Test ( Test.hs, Test.o )
|  
|   Tidy Core 
|  Result size = 14
|  
|  Rec {
|  Test.sum' [Occ=LoopBreaker]
|:: [GHC.Integer.Type.Integer]
|   -> GHC.Integer.Type.Integer -> GHC.Integer.Type.Integer
|  [GblId, Arity=2, Caf=NoCafRefs, Str=DmdType SS]
|  Test.sum' =
|\ (ds_daw :: [GHC.Integer.Type.Integer])
|  (n_a9J :: GHC.Integer.Type.Integer) ->
|  case ds_daw of _ {
|[] -> n_a9J;
|: x_a9K xs_a9L ->
|  Test.sum' xs_a9L (GHC.Integer.Type.plusInteger n_a9J x_a9K)
|  }
|  end Rec }
|  
|  
|  
|  % ghc -fforce-recomp -ddump-prep -O2 Test.hs
|  [1 of 1] Compiling Test ( Test.hs, Test.o )
|  
|   CorePrep 
|  Result size = 17
|  
|  Rec {
|  Test.sum' [Occ=LoopBreaker]
|:: [GHC.Integer.Type.Integer]
|   -> GHC.Integer.Type.Integer -> GHC.Integer.Type.Integer
|  [GblId, Arity=2, Caf=NoCafRefs, Str=DmdType SS, Unf=OtherCon []]
|  Test.sum' =
|\ (ds_saQ :: [GHC.Integer.Type.Integer])
|  (n_saS :: GHC.Integer.Type.Integer) ->
|  case ds_saQ of _ {
|[] -> n_saS;
|: x_saW xs_saV ->
|  case GHC.Integer.Type.plusInteger n_saS x_saW
|  of sat_saZ { __DEFAULT ->
|  Test.sum' xs_saV sat_saZ
|  }
|  }
|  end Rec }
|  
|  ___
|  Haskell-Cafe mailing list
|  Haskell-Cafe@haskell.org
|  http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Where's the case? or The difference between simpl and prep

2013-03-14 Thread Tom Ellis
The -ddump-simpl output below doesn't contain a case corresponding to the
seq in sum', but the -ddump-prep does.  Isn't the output from simpl the
input to prep?  If so, where does the case reappear from?  If not, how are
simpl and prep related?

It seems to have something to do with "Str=DmdType SS" but I don't
understand.  This seems to come from the IdInfo on the Id which is the
binder "Test.sum'" but [1] says that this information is optional so it
seems strange that such crucial information would be encoded there.

Thanks,

Tom

[1] 
http://www.haskell.org/ghc/docs/7.6.2/html/libraries/ghc-7.6.2/IdInfo.html#t:IdInfo


% cat Test.hs
module Test where

sum' :: [Integer] -> Integer -> Integer
sum' [] n = n
sum' (x:xs) n = n `seq` sum' xs (n + x)
% ghc -fforce-recomp -ddump-simpl -O2 Test.hs
[1 of 1] Compiling Test ( Test.hs, Test.o )

 Tidy Core 
Result size = 14

Rec {
Test.sum' [Occ=LoopBreaker]
  :: [GHC.Integer.Type.Integer]
 -> GHC.Integer.Type.Integer -> GHC.Integer.Type.Integer
[GblId, Arity=2, Caf=NoCafRefs, Str=DmdType SS]
Test.sum' =
  \ (ds_daw :: [GHC.Integer.Type.Integer])
(n_a9J :: GHC.Integer.Type.Integer) ->
case ds_daw of _ {
  [] -> n_a9J;
  : x_a9K xs_a9L ->
Test.sum' xs_a9L (GHC.Integer.Type.plusInteger n_a9J x_a9K)
}
end Rec }



% ghc -fforce-recomp -ddump-prep -O2 Test.hs 
[1 of 1] Compiling Test ( Test.hs, Test.o )

 CorePrep 
Result size = 17

Rec {
Test.sum' [Occ=LoopBreaker]
  :: [GHC.Integer.Type.Integer]
 -> GHC.Integer.Type.Integer -> GHC.Integer.Type.Integer
[GblId, Arity=2, Caf=NoCafRefs, Str=DmdType SS, Unf=OtherCon []]
Test.sum' =
  \ (ds_saQ :: [GHC.Integer.Type.Integer])
(n_saS :: GHC.Integer.Type.Integer) ->
case ds_saQ of _ {
  [] -> n_saS;
  : x_saW xs_saV ->
case GHC.Integer.Type.plusInteger n_saS x_saW
of sat_saZ { __DEFAULT ->
Test.sum' xs_saV sat_saZ
}
}
end Rec }

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Question about updating GHC on MacOS

2013-03-14 Thread Alfredo Di Napoli
>From my $0.2 experience, if you are planning of having multiple GHC
installation, it would be better to do a fresh install using the
bootstrapped GHC you can find on the website. Roughly I have done this way
(on my Mac and on My EC2 instance):

(inside a ghc bootstrapped folder)
./configure --prefix=~/Library/Haskell/ghc-xxx (where xxx is the version)
make install

(then inside ~/Library/Haskell)
ln -s ghc-xxx current
ln -s current/bin bin

This way my current GHC is pointing to current inside
~/Library/Haskell/current and my bin are updated accordingly (make sure to
add /bin to your $PATH!). Then you install cabal-install and you are pretty
much sorted. The advantage of this approach is that you have the control
over the installation process, but other suggestion (like Alp's one) are
pretty good too. Mostly depends on what you think will work best for you :)

A.

On 11 March 2013 11:33, Alp Mestanogullari  wrote:

> I don't think so. However, you can install the OS X binaries for ghc 7.6.2
> and make that sit just next to your Haskell Platform install. You can even
> use your existing cabal-install to install packages for the freshly
> installed ghc by doing 'cabal install foo --with-ghc=/path/to/ghc'. Just
> watch which ghc does become the default (it's a matter of replacing a
> symlink) and that it satisfies you.
>
>
> On Thu, Mar 7, 2013 at 10:50 PM, Graham Klyne  wrote:
>
>> Hi,
>>
>> I have Haskell Platform with GHC[i] 7.4.2 installed on a MacOS system.
>>  There's a problem with the handling of certain Markdown constructs in
>> literate Haskell (lines starting with '#') that I understand is fixed in
>> 7.6.2.
>>
>> Therefore, I'd like to be able to update my GHC installation to 7.6.2.
>>  But I haven't yet been able to find any instructions about how to upgrade
>> an existing GHC installation.  Am I missing something?
>>
>> #g
>> --
>>
>> __**_
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/**mailman/listinfo/haskell-cafe
>>
>
>
>
> --
> Alp Mestanogullari
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe