[Haskell-cafe] ghc-7.4 on CentOS-5.8 ?

2012-06-27 Thread Johannes Waldmann
Dear all, 

I need a recent ghc on a not-so-recent (?) CentOS.

The ghc binary package (7.2 or 7.4) does not work
because of a mismatch in the libc version.

ghc-7.0 is working but when I use it to compile 7.4,
it breaks with some linker error (relocation R_X86_64_PC32 ...)
it also suggests recompile with -fPIC but I don't see how.

(In this particular case, I absolutely cannot change/update the OS.)

Thanks, J.W.


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


Re: [Haskell-cafe] Long-running request/response protocol server using enumerator/iterator/iterIO/pipes/conduits/...

2012-06-27 Thread Erik de Castro Lopo
Michael Snoyman wrote:

 That's
 the reason I added connect-and-resume to conduit. I use the technique
 in warp[1], which in fact *does* support multiple request/response
 pairs due to connection keep-alive. But the code base isn't the
 easiest introduction to the technique. If there's interest, I'll try
 to put together a blog post on using connect-and-resume to solve this
 kind of problem.

+1

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

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


Re: [Haskell-cafe] ghc-7.4 on CentOS-5.8 ?

2012-06-27 Thread Peter Simons
Hi Johannes,

  ghc-7.0 is working but when I use it to compile 7.4,
  it breaks with some linker error (relocation R_X86_64_PC32 ...)
  it also suggests recompile with -fPIC but I don't see how.

I seem to remember that this is a problem with the old version of
GCC that's used to build the compiler. It can we avoided, though, by
disabling optimizations.

Try adding the following lines to a file called mk/build.mk before
running the build:

GhcLibWays = v
SRC_HC_OPTS= -H64m -O0 -fasm# -O -H64m
GhcStage1HcOpts= -O -fasm
GhcStage2HcOpts= -O0 -fasm  # -O2 -fasm
GhcLibHcOpts   = -O -fasm   # -O2 -XGenerics
GhcHcOpts  = -Rghc-timing
# GhcLibWays  += p
# GhcLibWays  += dyn
NoFibWays  =
STRIP_CMD  = :

I attached the RPM spec file that I used to build GHC 7.0.4 on
CentOS. It's quite likely that you can use it to automate the 7.4.x
build after editing some version numbers and file paths in it.

Good luck! :-)

Peter


Name:   ghc
Version:7.0.4
Release:1

Summary:Glorious Haskell Compiler
License:BSD
Group:  Compiler
URL:http://haskell.org/ghc

Prefix: /opt/ghc/7.0.4
BuildArch:  x86_64
ExclusiveArch:  x86_64
ExclusiveOS:Linux

Source: %{name}-%{version}.tar.gz
BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  ghc == 6.12.3
BuildRequires:  make
BuildRequires:  perl
BuildRequires:  python
BuildRequires:  gmp-devel
BuildRequires:  ncurses-devel
BuildRequires:  zlib-devel
BuildRequires:  gcc
Requires:   gmp-devel
Requires:   ncurses-devel
Requires:   zlib-devel
Requires:   gcc

%description
Glorious Haskell Compiler

%clean
%{__rm} -rf %{buildroot}

%prep
%setup

%build
cat mk/build.mk EOF
GhcLibWays = v
SRC_HC_OPTS= -H64m -O0 -fasm# -O -H64m
GhcStage1HcOpts= -O -fasm
GhcStage2HcOpts= -O0 -fasm  # -O2 -fasm
GhcLibHcOpts   = -O -fasm   # -O2 -XGenerics
GhcHcOpts  = -Rghc-timing
# GhcLibWays  += p
# GhcLibWays  += dyn
NoFibWays  =
STRIP_CMD  = :
EOF
./configure --prefix=%{prefix} --with-ghc=/opt/ghc/6.12.3/bin/ghc
make

%install
%{__rm} -rf %{buildroot}
make DESTDIR=%{buildroot} install

%files
%defattr(644,root,root,755)
%dir %{prefix}
%attr(755,root,root) %{prefix}/bin/ghc
%attr(755,root,root) %{prefix}/bin/ghc-%{version}
%attr(755,root,root) %{prefix}/bin/ghc-pkg
%attr(755,root,root) %{prefix}/bin/ghc-pkg-%{version}
%attr(755,root,root) %{prefix}/bin/ghci
%attr(755,root,root) %{prefix}/bin/ghci-%{version}
%attr(755,root,root) %{prefix}/bin/haddock
%attr(755,root,root) %{prefix}/bin/haddock-ghc-%{version}
%attr(755,root,root) %{prefix}/bin/hp2ps
%attr(755,root,root) %{prefix}/bin/hpc
%attr(755,root,root) %{prefix}/bin/hsc2hs
%attr(755,root,root) %{prefix}/bin/runghc
%attr(755,root,root) %{prefix}/bin/runhaskell
%{prefix}/lib
%{prefix}/share
%attr(755,root,root) %{prefix}/lib/ghc-%{version}/ghc
%attr(755,root,root) %{prefix}/lib/ghc-%{version}/ghc-pkg
%attr(755,root,root) %{prefix}/lib/ghc-%{version}/haddock
%attr(755,root,root) %{prefix}/lib/ghc-%{version}/hsc2hs
%attr(755,root,root) %{prefix}/lib/ghc-%{version}/runghc
%attr(755,root,root) %{prefix}/lib/ghc-%{version}/unlit

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


Re: [Haskell-cafe] not enough fusion?

2012-06-27 Thread Dominic Steinitz
Duncan Coutts duncan.coutts at googlemail.com writes:

 This could in principle be fixed with an arity raising transformation,

Do you have a reference to arity raising transformations?

Thanks, Dominic.


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


Re: [Haskell-cafe] Unambiguous choice implementation

2012-06-27 Thread Heinrich Apfelmus

Bartosz Milewski wrote:

I see. So your current implementation is not push, is it?


Reactive-banana includes two implementations: a pull-based model 
implementation that specifies the semantics and a push-based 
implementation for actual work. So, yes, reactive-banana is push-based.


Note that the qualification push-based is not straightforward to 
obtain. For instance, Elm is implementation in a style that looks 
push-based, but it doesn't optimize the case where no event / change 
happens, so it has the same efficiency as a pull-based implementation.


Conal's  unamb  combinator may have a similar problem, but I'm not sure.


The original
pull implementation in Fran also used Maybe events, but that was considered
inefficient. How is Reactive Banana better then Fran then?


I don't know much about the implementation of  Fran , but if I remember 
correctly, it uses the representation  Behavior a = Time - a  and this 
introduces other efficiency problems not present in reactive-banana.



Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


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


Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-06-27 Thread Tillmann Rendel

Hi Rico,

Rico Moorman wrote:

  data Tree = Leaf Integer | Branch (Tree Integer) (Tree Integer)

  amount:: Tree - Integer
  amount (Leaf x) = x
  amount (Branch t1 t2) = amountt1 + amountt2

[...] additional requirement: If the command-line flag --multiply is set,
the function amount computes the product instead of the sum.

How would you implement this requirement in Haskell without changing the
line amount (Leaf x) = x?



The (for me at least) most obvious way to do this would be, to make the
operation to be applied to determine the amount (+ or *) an explicit
parameter in the function's definition.

  data Tree a = Leaf a
  | Branch (Tree a) (Tree a)
  amount :: (a - a - a) - Tree a - a
  amount fun (Leaf x) = x
  amount fun (Branch t1 t2) = amount fun t1 `fun` amount fun t2


I agree: This is the most obvious way, and also a very good way. I would 
probably do it like this.



Which drawbacks do you see besides increased verbosity?


Well, you did change the equation amount (Leaf x) = x to amount fun 
(Leaf x) = x. In a larger example, this means that you need to change 
many lines of many functions, just to get the the value of fun from the 
point where it is known to the point where you need it.



[...] I am wondering which ways of doing this in Haskell you mean.


I thought of the following three options, but see also Nathan Howells 
email for another alternative (that is related to my option (1) below):



(1) Implicit parameters:

{-# LANGUAGE ImplicitParams #-}
data Tree = Leaf Integer | Branch Tree Tree

amount :: (?fun :: Integer - Integer - Integer) = Tree - Integer
amount (Leaf x) = x
amount (Branch t1 t2) = ?fun (amount t1) (amount t2)


(2) Lexical Scoping:

data Tree = Leaf Integer | Branch Tree Tree

amount :: (Integer - Integer - Integer) - Tree - Integer
amount fun = amount where {
amount (Leaf x) = x
; amount (Branch t1 t2) = fun (amount t1) (amount t2) }


(3) UnsafePerformIO:

import System.IO.Unsafe (unsafePerformIO)

data Tree = Leaf Integer | Branch Tree Tree

amount :: Tree - Integer
amount (Leaf x) = x
amount (Branch t1 t2) = fun (amount t1) (amount t2)
  where fun = unsafePerformIO ...


I'm not happy with any of these options. Personally, I would probably go 
ahead and transform the whole program just to get the value of fun to 
where it is needed. Nevertheless, having actually done this before, I 
understand why Martin Odersky doesn't like doing it :)


  Tillmann

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


Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-06-27 Thread Yves Parès
 I'm not happy with any of these options.

Why are you unhappy with the ImplicitParams option?

It's pretty much like resorting to a newtype, as it's been suggested before.

2012/6/27 Tillmann Rendel ren...@informatik.uni-marburg.de

 Hi Rico,

 Rico Moorman wrote:

  data Tree = Leaf Integer | Branch (Tree Integer) (Tree Integer)

  amount:: Tree - Integer
  amount (Leaf x) = x
  amount (Branch t1 t2) = amountt1 + amountt2

 [...] additional requirement: If the command-line flag --multiply is
 set,

 the function amount computes the product instead of the sum.

 How would you implement this requirement in Haskell without changing the
 line amount (Leaf x) = x?


  The (for me at least) most obvious way to do this would be, to make the
 operation to be applied to determine the amount (+ or *) an explicit
 parameter in the function's definition.


  data Tree a = Leaf a
  | Branch (Tree a) (Tree a)
  amount :: (a - a - a) - Tree a - a
  amount fun (Leaf x) = x
  amount fun (Branch t1 t2) = amount fun t1 `fun` amount fun t2


 I agree: This is the most obvious way, and also a very good way. I would
 probably do it like this.

  Which drawbacks do you see besides increased verbosity?


 Well, you did change the equation amount (Leaf x) = x to amount fun
 (Leaf x) = x. In a larger example, this means that you need to change many
 lines of many functions, just to get the the value of fun from the point
 where it is known to the point where you need it.

  [...] I am wondering which ways of doing this in Haskell you mean.


 I thought of the following three options, but see also Nathan Howells
 email for another alternative (that is related to my option (1) below):


 (1) Implicit parameters:

 {-# LANGUAGE ImplicitParams #-}
 data Tree = Leaf Integer | Branch Tree Tree

 amount :: (?fun :: Integer - Integer - Integer) = Tree - Integer

 amount (Leaf x) = x
 amount (Branch t1 t2) = ?fun (amount t1) (amount t2)


 (2) Lexical Scoping:

 data Tree = Leaf Integer | Branch Tree Tree

 amount :: (Integer - Integer - Integer) - Tree - Integer
 amount fun = amount where {

 amount (Leaf x) = x
 ; amount (Branch t1 t2) = fun (amount t1) (amount t2) }


 (3) UnsafePerformIO:

 import System.IO.Unsafe (unsafePerformIO)

 data Tree = Leaf Integer | Branch Tree Tree


 amount :: Tree - Integer
 amount (Leaf x) = x
 amount (Branch t1 t2) = fun (amount t1) (amount t2)
  where fun = unsafePerformIO ...


 I'm not happy with any of these options. Personally, I would probably go
 ahead and transform the whole program just to get the value of fun to where
 it is needed. Nevertheless, having actually done this before, I understand
 why Martin Odersky doesn't like doing it :)


  Tillmann

 __**_
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://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] Combining Network Descriptions in Reactive.Banana

2012-06-27 Thread Alexander Foremny
Hello list,

I am currently experimenting with Reactive.Banana and I am trying to
write a program that simply displays a String which is supplied by the
user. Thus in Main.hs I'd like to create a Behavior t String from some
arbitrary sources and pass this to a library function performing the
printing. However, I am not able to get the desired behavior of my
program. A sample Main.hs is available as Gist [1].

The cause of error appears to be that the type t over which
NetworkDescription and Behavior are parameterized are distinct! I
tried several variations of the code in [1] using
ExistentialQuantification over t and/or giving explicit type
signatures. The error is slightly different in each case, but always
boils down to the same reason.

In case explicit error messages are required I can post them to the list.

Any insight into this would be of great help. And additionally I'd be
interested if this kind of program is possible with Reactive.Banana at
all.

[1] https://gist.github.com/3004430

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


[Haskell-cafe] cabal doens't forget old dependencies

2012-06-27 Thread Sjoerd Visscher
Hi all,

I tried to install reactive-banana. This failed due to a dependency conflict, 
and then I noticed there was a newer version of reactive-banana. So I did cabal 
update, and tried to install again. But whatever I do, cabal keeps trying to 
install fclabels, but fclabels is no longer a dependency of 
reactive-banana-0.6.0.0! How can I let cabal forget this dependency?

Thanks,
--
Sjoerd Visscher
https://github.com/sjoerdvisscher/blog

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


Re: [Haskell-cafe] cabal doens't forget old dependencies

2012-06-27 Thread Andres Löh
Hi.

 I tried to install reactive-banana. This failed due to a dependency conflict, 
 and then I noticed there was a newer version of reactive-banana. So I did 
 cabal update, and tried to install again. But whatever I do, cabal keeps 
 trying to install fclabels, but fclabels is no longer a dependency of 
 reactive-banana-0.6.0.0! How can I let cabal forget this dependency?

From the reactive-banana Cabal file:

if flag(UseExtensions)
extensions: TypeFamilies, GADTs, MultiParamTypeClasses,
BangPatterns, TupleSections,
EmptyDataDecls
build-depends:  QuickCheck = 1.2   2.5,
fclabels == 1.1.*,
unordered-containers = 0.2.1.0   0.3,
hashable == 1.1.*
CPP-options:-DUseExtensions

So try -f-UseExtensions if you really want that?

Cheers,
  Andres


-- 
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com

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


Re: [Haskell-cafe] cabal doens't forget old dependencies

2012-06-27 Thread Albert Y. C. Lai

On 12-06-27 11:29 AM, Sjoerd Visscher wrote:

I tried to install reactive-banana. This failed due to a dependency conflict, 
and then I noticed there was a newer version of reactive-banana. So I did cabal 
update, and tried to install again. But whatever I do, cabal keeps trying to 
install fclabels, but fclabels is no longer a dependency of 
reactive-banana-0.6.0.0! How can I let cabal forget this dependency?


In 
http://hackage.haskell.org/packages/archive/reactive-banana/0.6.0.0/reactive-banana.cabal 
:


if flag(UseExtensions)
extensions: TypeFamilies, GADTs, MultiParamTypeClasses,
BangPatterns, TupleSections,
EmptyDataDecls
build-depends:  QuickCheck = 1.2   2.5,
fclabels == 1.1.*,
unordered-containers = 0.2.1.0   0.3,
hashable == 1.1.*
CPP-options:-DUseExtensions

Recall that the semantics of if flag is like Prolog not Pascal: if the 
packages under build-depends could be installed, then UseExtensions is 
set to true. Unless you manually override.


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


Re: [Haskell-cafe] cabal doens't forget old dependencies

2012-06-27 Thread Sjoerd Visscher
Ah, ok. I wasn't aware how flags work in Cabal, thanks.

Makes me wonder why that flag was turned off on hackage.
http://hackage.haskell.org/package/reactive-banana

On Jun 27, 2012, at 5:51 PM, Andres Löh wrote:

 Hi.
 
 I tried to install reactive-banana. This failed due to a dependency 
 conflict, and then I noticed there was a newer version of reactive-banana. 
 So I did cabal update, and tried to install again. But whatever I do, cabal 
 keeps trying to install fclabels, but fclabels is no longer a dependency of 
 reactive-banana-0.6.0.0! How can I let cabal forget this dependency?
 
 From the reactive-banana Cabal file:
 
if flag(UseExtensions)
extensions: TypeFamilies, GADTs, MultiParamTypeClasses,
BangPatterns, TupleSections,
EmptyDataDecls
build-depends:  QuickCheck = 1.2   2.5,
fclabels == 1.1.*,
unordered-containers = 0.2.1.0   0.3,
hashable == 1.1.*
CPP-options:-DUseExtensions
 
 So try -f-UseExtensions if you really want that?
 
 Cheers,
  Andres
 
 
 -- 
 Andres Löh, Haskell Consultant
 Well-Typed LLP, http://www.well-typed.com
 

--
Sjoerd Visscher
https://github.com/sjoerdvisscher/blog






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


Re: [Haskell-cafe] Combining Network Descriptions in Reactive.Banana

2012-06-27 Thread Sjoerd Visscher
This should work:

library :: (forall t. NetworkDescription t (Behavior t [Char])) - IO ()

greetings,
Sjoerd

On Jun 27, 2012, at 4:39 PM, Alexander Foremny wrote:

 Hello list,
 
 I am currently experimenting with Reactive.Banana and I am trying to
 write a program that simply displays a String which is supplied by the
 user. Thus in Main.hs I'd like to create a Behavior t String from some
 arbitrary sources and pass this to a library function performing the
 printing. However, I am not able to get the desired behavior of my
 program. A sample Main.hs is available as Gist [1].
 
 The cause of error appears to be that the type t over which
 NetworkDescription and Behavior are parameterized are distinct! I
 tried several variations of the code in [1] using
 ExistentialQuantification over t and/or giving explicit type
 signatures. The error is slightly different in each case, but always
 boils down to the same reason.
 
 In case explicit error messages are required I can post them to the list.
 
 Any insight into this would be of great help. And additionally I'd be
 interested if this kind of program is possible with Reactive.Banana at
 all.
 
 [1] https://gist.github.com/3004430
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 

--
Sjoerd Visscher
https://github.com/sjoerdvisscher/blog






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


Re: [Haskell-cafe] cabal doens't forget old dependencies

2012-06-27 Thread Andres Löh
Hi.

On Wed, Jun 27, 2012 at 6:14 PM, Sjoerd Visscher sjo...@w3future.com wrote:
 Ah, ok. I wasn't aware how flags work in Cabal, thanks.

 Makes me wonder why that flag was turned off on hackage.
 http://hackage.haskell.org/package/reactive-banana

I'm not sure it was turned off. I see that it lists only some of the
dependencies. It's a general phenomenon. I don't understand the way
Hackage lists package dependencies. I'd appreciate if it'd actually
show the whole conditional tree of dependencies.

Cheers,
  Andres

-- 
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com

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


Re: [Haskell-cafe] Combining Network Descriptions in Reactive.Banana

2012-06-27 Thread Alexander Foremny
Sweet! Thank you very much!

Just out of curiosity: how does this differ from the following, not
compiling type signature?

 library :: forall t. NetworkDescription t (Behavior t String) - IO ()

Regards,
Alexander Foremny

2012/6/27 Sjoerd Visscher sjo...@w3future.com:
 This should work:

    library :: (forall t. NetworkDescription t (Behavior t [Char])) - IO ()

 greetings,
 Sjoerd

 On Jun 27, 2012, at 4:39 PM, Alexander Foremny wrote:

 Hello list,

 I am currently experimenting with Reactive.Banana and I am trying to
 write a program that simply displays a String which is supplied by the
 user. Thus in Main.hs I'd like to create a Behavior t String from some
 arbitrary sources and pass this to a library function performing the
 printing. However, I am not able to get the desired behavior of my
 program. A sample Main.hs is available as Gist [1].

 The cause of error appears to be that the type t over which
 NetworkDescription and Behavior are parameterized are distinct! I
 tried several variations of the code in [1] using
 ExistentialQuantification over t and/or giving explicit type
 signatures. The error is slightly different in each case, but always
 boils down to the same reason.

 In case explicit error messages are required I can post them to the list.

 Any insight into this would be of great help. And additionally I'd be
 interested if this kind of program is possible with Reactive.Banana at
 all.

 [1] https://gist.github.com/3004430

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


 --
 Sjoerd Visscher
 https://github.com/sjoerdvisscher/blog






 ___
 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


Re: [Haskell-cafe] Combining Network Descriptions in Reactive.Banana

2012-06-27 Thread Sjoerd Visscher
That is the same as just

library :: NetworkDescription t (Behavior t String) - IO ()

which means that the caller gets to pick which type t stands for. But with 
this:

library :: (forall t. NetworkDescription t (Behavior t [Char])) - IO ()

the caller is forced to pass a value that works for any type t, and the library 
function gets to choose.

greetings,
Sjoerd

On Jun 27, 2012, at 8:57 PM, Alexander Foremny wrote:

 Sweet! Thank you very much!
 
 Just out of curiosity: how does this differ from the following, not
 compiling type signature?
 
 library :: forall t. NetworkDescription t (Behavior t String) - IO ()
 
 Regards,
 Alexander Foremny
 
 2012/6/27 Sjoerd Visscher sjo...@w3future.com:
 This should work:
 
library :: (forall t. NetworkDescription t (Behavior t [Char])) - IO ()
 
 greetings,
 Sjoerd
 
 On Jun 27, 2012, at 4:39 PM, Alexander Foremny wrote:
 
 Hello list,
 
 I am currently experimenting with Reactive.Banana and I am trying to
 write a program that simply displays a String which is supplied by the
 user. Thus in Main.hs I'd like to create a Behavior t String from some
 arbitrary sources and pass this to a library function performing the
 printing. However, I am not able to get the desired behavior of my
 program. A sample Main.hs is available as Gist [1].
 
 The cause of error appears to be that the type t over which
 NetworkDescription and Behavior are parameterized are distinct! I
 tried several variations of the code in [1] using
 ExistentialQuantification over t and/or giving explicit type
 signatures. The error is slightly different in each case, but always
 boils down to the same reason.
 
 In case explicit error messages are required I can post them to the list.
 
 Any insight into this would be of great help. And additionally I'd be
 interested if this kind of program is possible with Reactive.Banana at
 all.
 
 [1] https://gist.github.com/3004430
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 
 --
 Sjoerd Visscher
 https://github.com/sjoerdvisscher/blog
 
 
 
 
 
 
 ___
 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
 

--
Sjoerd Visscher
https://github.com/sjoerdvisscher/blog






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


Re: [Haskell-cafe] not enough fusion?

2012-06-27 Thread Thomas Schilling
It's described in Andy Gill's PhD thesis (which describes the
foldr/build fusion).
http://ittc.ku.edu/~andygill/paper.php?label=GillPhD96 Section 4.4
describes the basic ideas.  There aren't any further details, though.

Max's Strict Core paper also describes it a bit (Section 6):
http://www.cl.cam.ac.uk/~mb566/papers/tacc-hs09.pdf

On 27 June 2012 08:58, Dominic Steinitz domi...@steinitz.org wrote:
 Duncan Coutts duncan.coutts at googlemail.com writes:

 This could in principle be fixed with an arity raising transformation,

 Do you have a reference to arity raising transformations?

 Thanks, Dominic.


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



-- 
Push the envelope. Watch it bend.

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


Re: [Haskell-cafe] ANNOUNCE : Leksah 0.12.1.2 (fixes some metadata issues)

2012-06-27 Thread Sergei Trofimovich
On Wed, 20 Jun 2012 16:59:16 -0700
Hilco Wijbenga hilco.wijbe...@gmail.com wrote:

 Hi Hamish,
 
 On 19 June 2012 22:47, Hamish Mackenzie
 hamish.k.macken...@googlemail.com wrote:
  This release has an important bug fix for the metadata download.
  When metadata was downloaded using libcurl it was not treated
  as binary data.  If you used one of our binary installers or if you
  built Leksah with the -flibcurl flag then it is likely you have bad
  metadata files.
 
 I just tried (again) to install Leksah. I was wondering if you could
 point out where I go wrong. I'm on a fully up-to-date Gentoo Linux
 (kernel 3.4.3, 64 bit) box.
 
 I ran the following commands (as described, more or less, on
 http://leksah.org/download.html):
 
 hilco@centaur ~ ~$ rm -rf .cabal/
 
 hilco@centaur ~ ~$ cabal update
 Downloading the latest package list from hackage.haskell.org
 
 hilco@centaur ~ ~$ cabal install gtk2hs-buildtools
 Resolving dependencies...
 Downloading gtk2hs-buildtools-0.12.3.1...
 Configuring gtk2hs-buildtools-0.12.3.1...
 Building gtk2hs-buildtools-0.12.3.1...
 ... lots of output ...
 Linking dist/build/gtk2hsC2hs/gtk2hsC2hs ...
 Installing executable(s) in /home/hilco/.cabal/bin
 
 hilco@centaur ~ ~$ cabal install leksah
 Resolving dependencies...
 In order, the following would be installed:
 attoparsec-0.10.2.0 (reinstall) changes: text-0.11.2.2 added
 binary-shared-0.8.2 (new version)
 cairo-0.12.3.1 (new package)
 enumerator-0.4.19 (reinstall) changes: text-0.11.2.2 added,
 transformers-0.2.2.0 - 0.3.0.0
 attoparsec-enumerator-0.3 (reinstall) changes: text-0.11.2.2 added
 glib-0.12.3.1 (new package)
 gio-0.12.3 (new package)
 network-2.3.0.14 (reinstall) changes: parsec-3.1.2 - 3.1.3
 hslogger-1.1.5 (reinstall) changes: mtl-2.0.1.0 - 2.1.1
 pango-0.12.3 (new package)
 gtk-0.12.3.1 (new package)
 gtksourceview2-0.12.3.1 (new package)
 ltk-0.12.1.0 (new package)
 leksah-server-0.12.1.2 (new package)
 regex-base-0.93.2 (reinstall) changes: mtl-2.0.1.0 - 2.1.1
 regex-tdfa-1.1.8 (reinstall) changes: mtl-2.0.1.0 - 2.1.1, parsec-3.1.2 -
 3.1.3
 leksah-0.12.1.2 (new package)
 cabal: The following packages are likely to be broken by the reinstalls:
 regex-posix-0.95.1
 regex-compat-0.95.1
 Use --force-reinstalls if you want to install anyway.
 
 hilco@centaur ~ ~$ cabal install leksah --force-reinstalls
 Resolving dependencies...
 Warning: The following packages are likely to be broken by the reinstalls:
 regex-posix-0.95.1
 regex-compat-0.95.1
 Continuing even though the plan contains dangerous reinstalls.
 ... lots of output ...
 cabal: Error: some packages failed to install:
 cairo-0.12.3.1 failed during the configure step. The exception was:
 ExitFailure 1
 gio-0.12.3 depends on glib-0.12.3.1 which failed to install.
 glib-0.12.3.1 failed during the configure step. The exception was:
 ExitFailure 1
 gtk-0.12.3.1 depends on glib-0.12.3.1 which failed to install.
 gtksourceview2-0.12.3.1 depends on glib-0.12.3.1 which failed to install.
 leksah-0.12.1.2 depends on glib-0.12.3.1 which failed to install.
 leksah-server-0.12.1.2 depends on glib-0.12.3.1 which failed to install.
 ltk-0.12.1.0 depends on glib-0.12.3.1 which failed to install.
 pango-0.12.3 depends on glib-0.12.3.1 which failed to install.
 
 Any ideas?

You might like to try out installing leksah with stock emerge:

https://github.com/gentoo-haskell/gentoo-haskell/blob/master/README.rst

gtk2hs-buildtools seems to be buggy when ran the first time on certain headers:

http://www.mail-archive.com/gtk2hs-devel@lists.sourceforge.net/msg01160.html

gentoo-haskell overlay workarounds it by disabling binary cache:


https://github.com/gentoo-haskell/gentoo-haskell/blob/master/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.12.3-workaround-UName.patch

-- 

  Sergei


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


[Haskell-cafe] Haskell Weekly News: Issue 233

2012-06-27 Thread Daniel Santa Cruz
Welcome to issue 233 of the HWN, an issue covering crowd-sourced bits
of information about Haskell from around the web. This issue covers the
week of June 17 to 23, 2012.

Quotes of the Week

   * ciaranm: if it's ugly, it's imperative. if it's incomprehensible,
  it's functional.

   * xplat: when life gives you lemons, make lemonads

Top Reddit Stories

   * What are everyone's favorite aha moments in learning Haskell?
 Domain: self.haskell, Score: 93, Comments: 156
 On Reddit: [1] http://goo.gl/8YSyY
 Original: [2] http://goo.gl/8YSyY

   * Unit testing isn't enough. You need static typing too.
 Domain: evanfarrer.blogspot.ca, Score: 82, Comments: 22
 On Reddit: [3] http://goo.gl/b73gf
 Original: [4] http://goo.gl/JF4ND

   * Snap Framework 0.9 Released
 Domain: snapframework.com, Score: 60, Comments: 7
 On Reddit: [5] http://goo.gl/7fP9D
 Original: [6] http://goo.gl/7SoU6

   * Haskell’s record system is a cruel joke
 Domain: labs.scrive.com, Score: 52, Comments: 100
 On Reddit: [7] http://goo.gl/XKIch
 Original: [8] http://goo.gl/wOvyc

   * Polymorphic Update with van Laarhoven Lenses
 Domain: r6.ca, Score: 51, Comments: 9
 On Reddit: [9] http://goo.gl/qvpPg
 Original: [10] http://goo.gl/34TbY

   * Building a blog with Snap and Heist
 Domain: bonus500.github.com, Score: 45, Comments: 30
 On Reddit: [11] http://goo.gl/UDHCs
 Original: [12] http://goo.gl/eo9a3

   * Totality vs. Turing completeness (McBride)[PDF, 35 slides, ±]
 Domain: personal.cis.strath.ac.uk, Score: 42, Comments: 22
 On Reddit: [13] http://goo.gl/qua0n
 Original: [14] http://goo.gl/8auaP

   * GHC's imprecise (non-deterministic) error
 Domain: stackoverflow.com, Score: 41, Comments:
 On Reddit: [15] http://goo.gl/6WQWx
 Original: [16] http://goo.gl/MOCeT

   * Hackage comments — a simple user script
 Domain: chrisdone.com, Score: 39, Comments: 17
 On Reddit: [17] http://goo.gl/t9oBH
 Original: [18] http://goo.gl/CmXuB

   * A Notation for Comonads (Orchard, Mycroft) [pdf]
 Domain: cl.cam.ac.uk, Score: 38, Comments: 48
 On Reddit: [19] http://goo.gl/S4lz9
 Original: [20] http://goo.gl/uw8ZY

   * Taming list syntax in Haskell
 Domain: labs.scrive.com, Score: 36, Comments: 29
 On Reddit: [21] http://goo.gl/YLTZL
 Original: [22] http://goo.gl/UJpcB

   * Shell scripting with type-safety using Haskell « Linux-Magazin Online
 Domain: linux-magazin.de, Score: 36, Comments: 32
 On Reddit: [23] http://goo.gl/yEMQ0
 Original: [24] http://goo.gl/U3zO5

   * Roy, A Statically Typed, Functional Language for Javascript.
 The Functional Web [PDF]
 Domain: brianmckenna.org, Score: 32, Comments: 9
 On Reddit: [25] http://goo.gl/SBhec
 Original: [26] http://goo.gl/v0iH2

   * [ANN] GenCheck - a generalized property-based testing framework
 Domain: permalink.gmane.org, Score: 30, Comments:
 On Reddit: [27] http://goo.gl/GCUGJ
 Original: [28] http://goo.gl/c2Y0s

Top StackOverflow Questions

   * How do exceptions in Haskell work?
 votes: 53, answers: 1
 Read on SO: [29] http://goo.gl/MOCeT

   * Has anyone ever compiled a list of the imports needed to avoid the
 “not polymorphic enough” definitions in Haskell's standard libraries?
 votes: 19, answers: 1
 Read on SO: [30] http://goo.gl/kyXde

   * Why does adding a polymorphic type signature degrade performance?
 votes: 13, answers: 2
 Read on SO: [31] http://goo.gl/Lf18k

   * To write or not to write `module Main where` in Haskell
 votes: 10, answers: 1
 Read on SO: [32] http://goo.gl/IDSOx

   * Why aren't FingerTrees used enough to have a stable implementation?
 votes: 10, answers: 3
 Read on SO: [33] http://goo.gl/wzw4e

   * What is the difference between PArray and [::] in Data Parallel Haskell?
 votes: 9, answers: 0
 Read on SO: [34] http://goo.gl/FpUJX

   * Why discarded values are () instead of ⊥ in Haskell?
 votes: 8, answers: 5
 Read on SO: [35] http://goo.gl/jIK26

   * Is it possible to embed Haskell in a C library opaquely?
 votes: 8, answers: 1
 Read on SO: [36] http://goo.gl/3H5tu

   * NoMonomorphismRestriction helps preserve sharing?
 votes: 8, answers: 2
 Read on SO: [37] http://goo.gl/FDdeA

   * Why doesn't Haskell/GHC support record name overloading
 votes: 7, answers: 2
 Read on SO: [38] http://goo.gl/NsHKM


Until next time,
Daniel Santa Cruz

References


   1. 
http://www.reddit.com/r/haskell/comments/vi425/what_are_everyones_favorite_aha_moments_in/
   2. 
http://www.reddit.com/r/haskell/comments/vi425/what_are_everyones_favorite_aha_moments_in/
   3. 
http://evanfarrer.blogspot.ca/2012/06/unit-testing-isnt-enough-you-need.html
   4. 
http://www.reddit.com/r/haskell/comments/vbwrv/unit_testing_isnt_enough_you_need_static_typing/
   5. http://snapframework.com/blog/2012/06/17/snap-0.9-released
   6. 

Re: [Haskell-cafe] ghc-7.4 on CentOS-5.8 ?

2012-06-27 Thread Tim Docker
Here's the steps I had to go go to get ghc7.0 working on RHEL 5.6:

http://twdkz.wordpress.com/2011/12/21/installing-ghc-7-0-3-and-the-haskell-platform-on-rhel-5-6/

I expect that the same steps will work for ghc 7.4.  I need to use a more 
recent version of gcc that than supplied with RHEL5.6.

Tim


On 27/06/2012, at 5:33 PM, Johannes Waldmann wrote:

 Dear all, 
 
 I need a recent ghc on a not-so-recent (?) CentOS.
 
 The ghc binary package (7.2 or 7.4) does not work
 because of a mismatch in the libc version.
 
 ghc-7.0 is working but when I use it to compile 7.4,
 it breaks with some linker error (relocation R_X86_64_PC32 ...)
 it also suggests recompile with -fPIC but I don't see how.
 
 (In this particular case, I absolutely cannot change/update the OS.)
 
 Thanks, J.W.
 
 
 ___
 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] Scribd's AI challenge has Haskell support

2012-06-27 Thread aditya bhargava
Hey all,
I work at scribd.com. A few weeks ago we had released an AI game. It
allowed you to use Javascript to program a bot. I've been wanting to add
Haskell as a supported language for some time, and it's finally done! I'm
pretty excited since I think we are the first big company to do something
like this. Supporting Haskell was trivial thanks to GHC 7.4's Safe Haskell
extension. I hope more companies support Haskell in the future!

Here's the game: *http://www.scribd.com/jobs/botrace*
Here's the tutorial I wrote for Haskell: *
http://egonschiele.github.com/robot-fruit-hunt/*
Here's the Haskell API: *
https://github.com/egonSchiele/robot-fruit-hunt/blob/master/haskell/HaskellAPI.markdown
*
Here's a sandbox that allows you to test bots locally: *
https://github.com/egonSchiele/robot-fruit-hunt*

Comments and feedback welcome!


Adit

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


Re: [Haskell-cafe] ghc-7.4 on CentOS-5.8 ?

2012-06-27 Thread aditya bhargava
Johannes,
This worked for me: http://justhub.org/download


Adit


On Wed, Jun 27, 2012 at 4:05 PM, Tim Docker t...@dockerz.net wrote:

 Here's the steps I had to go go to get ghc7.0 working on RHEL 5.6:


 http://twdkz.wordpress.com/2011/12/21/installing-ghc-7-0-3-and-the-haskell-platform-on-rhel-5-6/

 I expect that the same steps will work for ghc 7.4.  I need to use a more
 recent version of gcc that than supplied with RHEL5.6.

 Tim


 On 27/06/2012, at 5:33 PM, Johannes Waldmann wrote:

  Dear all,
 
  I need a recent ghc on a not-so-recent (?) CentOS.
 
  The ghc binary package (7.2 or 7.4) does not work
  because of a mismatch in the libc version.
 
  ghc-7.0 is working but when I use it to compile 7.4,
  it breaks with some linker error (relocation R_X86_64_PC32 ...)
  it also suggests recompile with -fPIC but I don't see how.
 
  (In this particular case, I absolutely cannot change/update the OS.)
 
  Thanks, J.W.
 
 
  ___
  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




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