Re: [Haskell-cafe] A Mascot

2011-11-21 Thread Karol Samborski
Hi all,

This is my sister's proposition:
http://origami.bieszczady.pl/images/The_Lamb_Da.png

What do you think?

Best,
Karol Samborski

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


Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Heinrich Apfelmus

Tim Baumgartner wrote:

Thanks a lot! Althaugh I have some understanding of the Haskell basics and
the most important monads, I feel that I have to see more well designed
code in order to become a good Haskeller. Can somebody make suggestions
what materials are best to work through in order to achieve this? Are there
easy research papers about Haskell programming? Or should I try the
Monad.Reader? I'm looking for topics that either can be used directly in
many situations or that show some functional principles that boost my
creativity and functional thinking.


You may want to start with the Functional Pearls

  http://www.haskell.org/haskellwiki/Research_papers/Functional_pearls

In particular, I recommend

  * Richard Bird. A program to solve Sudoku.
  * Graham Hutton. The countdown problem.
  * Martin Erwig and Steve Kollmansberger.
Probabilistic functional programming in Haskell.
  * Conor McBride and Ross Paterson.
Applicative Programming with Effects.


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] Lifted Spine View

2011-11-21 Thread Andres Löh
Hi there.

    I tried to follow the program of the paper Scrap your boilerpolate
 Revolutions. Unfortunately,
 I found the program in the section lifted spine view does not compile in my
 GHC, could anybody
  point out where I am wrong? Many Thanks

 My code is posted here http://hpaste.org/54357

You have to flip the two fields of (:-), i.e., the type has to be
first and the annotated term has to be second. This is because pattern
matching on GADTs and refinement is implicitly left-to-right in GHC.
The paper presents it the other way round and remarks on the flipped
order in a footnote near the beginning.

Cheers,
  Andres

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


Re: [Haskell-cafe] Superset of Haddock and Markdown

2011-11-21 Thread Malcolm Wallace

On 20 Nov 2011, at 22:20, Ivan Lazar Miljenovic wrote:

 On 21 November 2011 03:19, David Fox dds...@gmail.com wrote:
 On Fri, Nov 18, 2011 at 1:10 AM, Ertugrul Soeylemez e...@ertes.de wrote:
 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
 
 Wasn't there talk at one stage of integrating pandoc into haddock?
 
 I wouldn't mind Haddock depending on Pandoc, at least optionally
 (-fmarkdown-comments).  Taking this to its conclusion you could easily
 have syntax-highlighted code examples in Haddock documentations and
 allow alternative output formats.
 
 I'm not sure the pandoc license (GPL) is compatible with the GHC license.
 
 Do you mean because GHC ships with a Haddock binary?

GHC also ships with a GPL'd gcc binary, on at least some platforms.

Regards,
Malcolm

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


Re: [Haskell-cafe] Decision procedure for foldr/foldl/foldl'?

2011-11-21 Thread Yves Parès
I would say a good practice with folds (and maybe in Haskell in general) is
that either all be strict or all be lazy.

In the expression: foldXX f init list:

Remember that foldr does:
x `f` ( ... the accumulator ... )
and foldl:
(... the accumulator ...) `f` x

The accumulator has to match a non-strict argument of* f*, so that *f* will
be able to return results *even if* the accumulator is not fully evaluated.

More detailed:
if *f* is lazy in its second argument, then use foldr. Everything is lazy,
you build a very small thunk since nothing is evaluated.
In the rare cases where* f *is (also) lazy in its first argument, you can
use foldl.
And of course, if *f* is strict in both its arguments, then use foldl'.
Everything is then strict, you build no thunk.



2011/11/20 David Fox dds...@gmail.com

 Does anyone have a quick way to decide which of the fold functions to
 use in a given situation?  There are times when I would like to find
 out which to use in the quickest way possible, rather than reading a
 long explanation of why each one behaves the way it does.

 ___
 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] Decision procedure for foldr/foldl/foldl'?

2011-11-21 Thread Jerzy Karczmarczuk

Yves Parès:
if *f* is lazy in its second argument, then use foldr. Everything is 
lazy, you build a very small thunk since nothing is evaluated.
In the rare cases where*f *is (also) lazy in its first argument, you 
can use foldl.

...
I have the impression that this is not the most useful advice possible.

1. Nothing is evaluated?? Look, foldr is designed to consume 
incrementally the list argument, and to produce, also incrementally the 
result ; it may stop in the middle if f is lazy, but if you organize 
badly your program, you will pollute your memory. You might wish to 
process the whole of the list as fast as possible, and then foldr may be 
dangerous. You may build a veeery big thunk before its reduction.


2. This is not only the issue: f x z versus f z x. foldl is 
iterative (tail-recursive) and the reduction proceeds until all the 
source list is consumed. foldl works better with strict functions, not lazy.


(of course, unless I am mistaken...)
==

In general, sorry for the cynism, but when I read:

There are times when I would like to find out which to use in the 
quickest way possible, rather than reading a long explanation of why 
each one behaves the way it does of David Fox, I compare it with a 
question of a young army officer, addressed to his elders:


Tell me how to win the war in the quickest way possible, rather than 
boring me with the explanations behind all those complicated strategies.


Jerzy Karczmarczuk
Caen, Normandy, France

(William the Conqueror, who lived here, had a reputation of a strategist 
who tried to understand his enemies. 350 years later, the French didn't 
try to understand anything, they just wanted to win the battle of 
Azincourt as quick as possible).


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


Re: [Haskell-cafe] A Mascot

2011-11-21 Thread Karol Samborski
2011/11/21 Karol Samborski edv.ka...@gmail.com:
 Hi all,

 This is my sister's proposition:
 http://origami.bieszczady.pl/images/The_Lamb_Da.png

 What do you think?


Second version: http://origami.bieszczady.pl/images/The_Lamb_Da2.png

Best,
Karol Samborski

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


[Haskell-cafe] Drawing charts over a lot of data

2011-11-21 Thread Eugene Kirpichov
Hi cafe,

Are there any (possibly unfinished?) libraries dedicated to drawing charts
over large amounts of data? I mean, such amounts that you don't want to
store the whole set of input data in memory and instead you prefer to do
one or a few passes over the input, calling the library's drawing functions
for each data point.

I'm currently using the excellent Chart package
http://hackage.haskell.org/package/Chart , but it seems to require quite a
bit of work to become usable in this mode (I haven't looked really deep
yet).

So, I'd be happy if someone pointed me to an existing package (I didn't
find one on hackage) or if someone expressed interest in making Chart avoid
having the whole input in memory.

-- 
Eugene Kirpichov
Principal Engineer, Mirantis Inc. http://www.mirantis.com/
Editor, http://fprog.ru/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Drawing charts over a lot of data

2011-11-21 Thread Felipe Almeida Lessa
This doesn't directly solve your problem, but you may want to take a
look at zoom-cache [1].  I've never used it myself, but it seems
pretty nice.

Cheers,

[1] http://hackage.haskell.org/package/zoom-cache

-- 
Felipe.

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


Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Yves Parès
I've read Martin Erwig and Steve Kollmansberger's *Probabilistic functional
programming in Haskell*.
Does someone know if the library they are talking about is available on
hackage?

2011/11/21 Heinrich Apfelmus apfel...@quantentunnel.de

 Tim Baumgartner wrote:

 Thanks a lot! Althaugh I have some understanding of the Haskell basics and
 the most important monads, I feel that I have to see more well designed
 code in order to become a good Haskeller. Can somebody make suggestions
 what materials are best to work through in order to achieve this? Are
 there
 easy research papers about Haskell programming? Or should I try the
 Monad.Reader? I'm looking for topics that either can be used directly in
 many situations or that show some functional principles that boost my
 creativity and functional thinking.


 You may want to start with the Functional Pearls

  
 http://www.haskell.org/**haskellwiki/Research_papers/**Functional_pearlshttp://www.haskell.org/haskellwiki/Research_papers/Functional_pearls

 In particular, I recommend

  * Richard Bird. A program to solve Sudoku.
  * Graham Hutton. The countdown problem.
  * Martin Erwig and Steve Kollmansberger.
Probabilistic functional programming in Haskell.
  * Conor McBride and Ross Paterson.
Applicative Programming with Effects.


 Best regards,
 Heinrich Apfelmus

 --
 http://apfelmus.nfshost.com



 __**_
 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


Re: [Haskell-cafe] Decision procedure for foldr/foldl/foldl'?

2011-11-21 Thread David Fox
On Mon, Nov 21, 2011 at 4:44 AM, Jerzy Karczmarczuk
jerzy.karczmarc...@unicaen.fr wrote:

 In general, sorry for the cynism, but when I read:

 There are times when I would like to find out which to use in the quickest
 way possible, rather than reading a long explanation of why each one behaves
 the way it does of David Fox, I compare it with a question of a young army
 officer, addressed to his elders:

 Tell me how to win the war in the quickest way possible, rather than boring
 me with the explanations behind all those complicated strategies.

I'm not trying to avoid learning the differences between the different
folds, but I am looking for a mnemonic device that will allow me to
proceed more quickly towards my goal.  My ultimate goal is to write
software, not to understand folds.   Just as it is inappropriate for a
young officer to even contemplate an overall strategy for winning the
war, it would be inappropriate for a general to spend more time than
necessary on the minute details of military tactics, as vital as they
are.

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


Re: [Haskell-cafe] Deduce problem.

2011-11-21 Thread Ben Franksen
Magicloud Magiclouds wrote:
 So I think I got what you guys meant, I limited ClassB to only H.
 Then how to archive my requirement, that from and to only return items
 that instanced ClassB?

If you are willing to go beyond Haskell98 (or Haskell2010), you can use a 
multi-parameter class. Enable the extension:

{-# LANGUAGE MultiParamTypeClasses #-}

An then, instead of

class (ClassA a) = ClassC a where
  from :: (ClassB b) = a - [b]
  to :: (ClassB c) = a - [c]

you say

class (ClassA a, ClassB b) = ClassC a b c where
  from :: c - [b]
  to :: c - [a]

This means that for each triple of concrete types (a,b,c) that you wish to 
be an instance of ClassC, you must provide an instance declaration, e.g.

instance ClassC Test H H where
  from = ...whatever...
  to = ...whatever...

Now you have the fixed type H in the instance declaration and not a 
universally quantified type variable.

Cheers
Ben


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


Re: [Haskell-cafe] Superset of Haddock and Markdown

2011-11-21 Thread David Fox
On Sun, Nov 20, 2011 at 2:20 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
 On 21 November 2011 03:19, David Fox dds...@gmail.com wrote:
 On Fri, Nov 18, 2011 at 1:10 AM, Ertugrul Soeylemez e...@ertes.de wrote:
 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:

 Wasn't there talk at one stage of integrating pandoc into haddock?

 I wouldn't mind Haddock depending on Pandoc, at least optionally
 (-fmarkdown-comments).  Taking this to its conclusion you could easily
 have syntax-highlighted code examples in Haddock documentations and
 allow alternative output formats.

 I'm not sure the pandoc license (GPL) is compatible with the GHC license.

 Do you mean because GHC ships with a Haddock binary?


Haddock carries the same license as GHC.

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


Re: [Haskell-cafe] Superset of Haddock and Markdown

2011-11-21 Thread Brandon Allbery
On Mon, Nov 21, 2011 at 12:28, David Fox dds...@gmail.com wrote:

 On Sun, Nov 20, 2011 at 2:20 PM, Ivan Lazar Miljenovic
 ivan.miljeno...@gmail.com wrote:
  On 21 November 2011 03:19, David Fox dds...@gmail.com wrote:
  I'm not sure the pandoc license (GPL) is compatible with the GHC
 license.
  Do you mean because GHC ships with a Haddock binary?

 Haddock carries the same license as GHC.


More to the point, Haddock uses ghc internals these days; it's not just a
matter of bundling, and the licenses *must* be compatible.

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Stephen Tetley
On 21 November 2011 14:48, Yves Parès limestr...@gmail.com wrote:
 I've read Martin Erwig and Steve Kollmansberger's Probabilistic functional
 programming in Haskell.
 Does someone know if the library they are talking about is available on
 hackage?

Henning Thielemann has a batteries included version on Hackage:

http://hackage.haskell.org/package/probability

I'd expect the original (micro) library is still available from Martin
Erwig's website.

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


Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Tim Baumgartner
Free Monads. It's amazing to be confronted again with notions I learned
more than ten years ago for groups. I have to admit that I'm probably not
yet prepared for a deeper understanding of this, but hopefully I will
return to it later ;-)
Is Cont free as well? I guess so because I heard it's sometimes called the
mother of all monads.

Regards
Tim

2011/11/21 David Menendez d...@zednenem.com

 On Sat, Nov 19, 2011 at 3:29 PM, Felipe Almeida Lessa
 felipe.le...@gmail.com wrote:
  On Sat, Nov 19, 2011 at 6:08 PM, Tim Baumgartner
  baumgartner@googlemail.com wrote:
  I have not yet gained a good understanding of the continuation monad,
 but I
  wonder if it could be used here. What would a clean solution look like?
  Perhaps there are other things that need to be changed as well?
 
  Your 'Interaction' data type is actually an instance of the more
  general operational monad (as named by Heinrich Apfelmus) or prompt
  monad (as named by Ryan Ingram).

 Both of which are just disguised free monads. For reference:


 data Free f a = Val a | Wrap (f (Free f a))

 foldFree :: Functor f = (a - b) - (f b - b) - Free f a - b
 foldFree v w (Val a)  = v a
 foldFree v w (Wrap t) = w $ fmap (foldFree v w) t

 instance Functor f = Monad (Free f) where
return  = Val
m = f = foldFree f Wrap m



 To use Free, just find the signature functor for Interaction by
 replacing the recursive instances with a new type variable,

 data InteractionF a b x = ExitF b
| OutputF b x
| InputF (a - x)

 instance Functor (InteractionF a b) where
fmap f (ExitF b) = ExitF b
fmap f (OutputF b x) = OutputF b (f x)
fmap f (InputF g)= InputF (f . g)

 roll :: InteractionF a b (Interaction a b) - Interaction a b
 roll (ExitF b) = Exit b
 roll (OutputF b x) = Output b x
 roll (InputF g)= Input g


 type InteractionM a b = Free (InteractionF a b)

 runM :: InteractionM a b b - Interaction a b
 runM = foldFree Exit roll

 exit :: b - InteractionM a b c
 exit b = Wrap (ExitF b)

 output :: b - InteractionM a b ()
 output b = Wrap (OutputF b (Val ()))

 input :: InteractionM a b a
 input = Wrap (InputF Val)

 --
 Dave Menendez d...@zednenem.com
 http://www.eyrie.org/~zednenem/

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


Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Tim Baumgartner
Hi Heinrich,

I read your article about the operational monad and found it really very
enlightening. So I'm curious to work through the material you linked below.
Thanks!

Regards
Tim


2011/11/21 Heinrich Apfelmus apfel...@quantentunnel.de

 Tim Baumgartner wrote:

 Thanks a lot! Althaugh I have some understanding of the Haskell basics and
 the most important monads, I feel that I have to see more well designed
 code in order to become a good Haskeller. Can somebody make suggestions
 what materials are best to work through in order to achieve this? Are
 there
 easy research papers about Haskell programming? Or should I try the
 Monad.Reader? I'm looking for topics that either can be used directly in
 many situations or that show some functional principles that boost my
 creativity and functional thinking.


 You may want to start with the Functional Pearls

  
 http://www.haskell.org/**haskellwiki/Research_papers/**Functional_pearlshttp://www.haskell.org/haskellwiki/Research_papers/Functional_pearls

 In particular, I recommend

  * Richard Bird. A program to solve Sudoku.
  * Graham Hutton. The countdown problem.
  * Martin Erwig and Steve Kollmansberger.
Probabilistic functional programming in Haskell.
  * Conor McBride and Ross Paterson.
Applicative Programming with Effects.


 Best regards,
 Heinrich Apfelmus

 --
 http://apfelmus.nfshost.com


 __**_
 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


Re: [Haskell-cafe] A Mascot

2011-11-21 Thread heathmatlock
Cute! I like it!

On Mon, Nov 21, 2011 at 7:52 AM, Karol Samborski edv.ka...@gmail.comwrote:

 2011/11/21 Karol Samborski edv.ka...@gmail.com:
  Hi all,
 
  This is my sister's proposition:
  http://origami.bieszczady.pl/images/The_Lamb_Da.png
 
  What do you think?
 

 Second version: http://origami.bieszczady.pl/images/The_Lamb_Da2.png

 Best,
 Karol Samborski

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




-- 
Heath Matlock
+1 256 274 4225
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Lifted Spine View

2011-11-21 Thread bob zhang
Thanks,  I don't see the footnote, but that works. :-)

On Mon, Nov 21, 2011 at 5:15 AM, Andres Löh andres.l...@googlemail.comwrote:

 Hi there.

 I tried to follow the program of the paper Scrap your boilerpolate
  Revolutions. Unfortunately,
  I found the program in the section lifted spine view does not compile in
 my
  GHC, could anybody
   point out where I am wrong? Many Thanks
 
  My code is posted here http://hpaste.org/54357

 You have to flip the two fields of (:-), i.e., the type has to be
 first and the annotated term has to be second. This is because pattern
 matching on GADTs and refinement is implicitly left-to-right in GHC.
 The paper presents it the other way round and remarks on the flipped
 order in a footnote near the beginning.

 Cheers,
  Andres




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


Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread David Menendez
On Mon, Nov 21, 2011 at 2:13 PM, Tim Baumgartner
baumgartner@googlemail.com wrote:
 Free Monads. It's amazing to be confronted again with notions I learned more
 than ten years ago for groups. I have to admit that I'm probably not yet
 prepared for a deeper understanding of this, but hopefully I will return to
 it later ;-)
 Is Cont free as well? I guess so because I heard it's sometimes called the
 mother of all monads.

As I understand it, Cont is not a free monad, but there is a
connection between the ideas. Certainly, any free monad can be easily
reimplemented using Cont.

Here's how you might implement your monad using Cont,

type InteractionM a b = Cont (Interaction a b)

exit b   = Cont $ \k - Exit b
output b = Cont $ \k - Output b (k ())
input= Cont $ \k - Input k
runM m   = runCont m Exit

That's very similar to the free monad's implementation, only with the
continuation replacing Val.

exit b   = Wrap $ ExitF b
output b = Wrap $ OutputF b (Val ())
input= Wrap $ InputF Val
runM m   = foldFree Exit roll m

The Cont-based version has essentially taken the work performed in
foldFree and distributed it to  return and (=). This eliminates the
intermediate data structures, resulting in a more efficient
implementation.

-- 
Dave Menendez d...@zednenem.com
http://www.eyrie.org/~zednenem/

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


Re: [Haskell-cafe] Superset of Haddock and Markdown

2011-11-21 Thread Thomas Schilling
On 21 November 2011 17:34, Brandon Allbery allber...@gmail.com wrote:
 Haddock carries the same license as GHC.

 More to the point, Haddock uses ghc internals these days; it's not just a
 matter of bundling, and the licenses *must* be compatible.

No.  If the haddock library any program that links against that
library (e.g., the haddock program) effectively becomes GPL licensed
(roughly speaking).  However, ghc and none of the core libraries link
against haddock, so that's not a problem.  You could run into issues
if you wanted to write a closed-source program that links against the
haddock library.

I generally don't like GPL-licensed libraries for that reason, but in
this case I think it would be fine.

 (Of course, the issue is that many tools start out as programs and
then turn into libraries -- pandoc is a good example.  At that point
GPL becomes an issue again.)

-- 
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] Interpreter with Cont

2011-11-21 Thread Tim Baumgartner
2011/11/21 David Menendez d...@zednenem.com


 Here's how you might implement your monad using Cont,

 type InteractionM a b = Cont (Interaction a b)

 exit b   = Cont $ \k - Exit b
 output b = Cont $ \k - Output b (k ())
 input= Cont $ \k - Input k
 runM m   = runCont m Exit


That's what I originally wanted to know. I guess I struggled with the
definition of output.
Oh, there's so much more to learn...

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


Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Ben Franksen
You'll probably get answers from people who are more proficient with this, 
but here's what I learned over the years.

Tim Baumgartner wrote:
 Is Cont free as well?

No. In fact, free monads are quite a special case, many monads are not free, 
e.g. the list monad. I believe what David Menendez said was meant to mean 
'modulo some equivalence relation' i.e. you can define/implement many monads 
as 'quotients' of a free monad. But you cannot do this with Cont (though I 
am not able to give a proof).

 I guess so because I heard it's sometimes called the
 mother of all monads.

It is, in the sense that you can implement all monads in terms of Cont.

Cheers
Ben


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


[Haskell-cafe] Job Opportunity at Parallel Scientific

2011-11-21 Thread Peter Braam
Parallel Haskell Programmers

Parallel Scientific, LLC is a Boulder, CO based early stage, but funded
startup company working in the area of scalable parallelization for
scientific and large data computing.  We are implementing radically new
software tools for the creation and optimization of parallel programs
benefiting applications and leveraging modern systems architecture. We
build on our mathematical knowledge, cutting edge programming languages and
our understanding of systems software and hardware.  We are currently
working with the Haskell development team and major HPC laboratories world
wide on libraries and compiler extensions for parallel programming.

Parallel Scientific was founded by Peter Braam in 2010.  Peter formerly
taught mathematics and computer science at Oxford and Carnegie Mellon.
 Then he contributed file systems to Linux and invented Lustre (which
provides storage to 9 of the top 10 systems in the world). He ran several
successful startups, and Parallel Scientific is run by an very experienced
management team and board.

Successful candidates can in some cases work remotely and will work in a
modern virtual environment.  We provide training in advanced processes for
software design and implementation and domain specific knowledge.

Required skills:

   - Very strong background in computer science or mathematics
   - Experience with Haskell
   - Knowledge of systems programming and operating systems functionality
   - Knowledge of system architectures, such as high performance
   networking, memory architectures, multi and manycore CPUs and GPGPUs
   - Experience with performance tuning of parallel or concurrent algorithms
   - Experience designing and implementing concurrent or parallel programs



Experience in one or more of the following areas is desirable:

   - Experience with Haskell compiler technology
   - In depth knowledge of core Haskell libraries for parallel programming
   (NDP, REPA etc)
   - Experience in the area of middleware algorithms for data flow
   programming, graphs, cloud based data analytics, or sparse matrices
   - Domain specific knowledge in scientific programming areas related to
   irregular and sparse problems, e.g. data analytics using graph analysis,
   genomics, tightly connected numerical analysis
   - Experience with performance tuning for parallel applications on multi
   core systems (e.g. with the Intel toolkit), for GPGPU's using Cuda/OpenCL
   or with MPI/OpenMP on clusters of SMPs



To apply, please send a resume to j...@parsci.com.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] A Mascot

2011-11-21 Thread Ben Franksen
heathmatlock wrote:
 Cute! I like it!

Yea, it's cute. I don't like the formula, though: \x - x + x is just too 
trivial and not very Haskellish. Something higher order is the minimum 
requirement, IMO. The original (lambda knights) formula was cool: the fixed 
point operator is directly related to recursion, which is reflected in the 
picture that contains itself; note also that defining this operator requires 
an untyped language, so this fits LISP quite well (but not Haskell).

What about the formula for function composition

  (f . g) x = f (g x)

maybe together with its type (or maybe only the type)

  (.) :: (b - c) - (a - b) - a - c

Extremely cool are GADTs, such as

  data Eq a b where Refl :: Eq a a

Or, if you'd like something more obscure but still at the center of what 
Haskell is about, take the mother of all monads

  m = f = \k - m (\a - (f a) k)

This is a formula I can spend a day contemplating and still wonder if I have 
_really_ understood it. And doesn't that properly reflect the depth and 
richness of Haskell?

Cheers
Ben

 On Mon, Nov 21, 2011 at 7:52 AM, Karol Samborski
 edv.ka...@gmail.comwrote:
 
 2011/11/21 Karol Samborski edv.ka...@gmail.com:
  Hi all,
 
  This is my sister's proposition:
  http://origami.bieszczady.pl/images/The_Lamb_Da.png
 
  What do you think?
 

 Second version: http://origami.bieszczady.pl/images/The_Lamb_Da2.png

 Best,
 Karol Samborski

 ___
 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] Drawing charts over a lot of data

2011-11-21 Thread Conrad Parker
On 21 November 2011 22:36, Felipe Almeida Lessa felipe.le...@gmail.com wrote:
 This doesn't directly solve your problem, but you may want to take a
 look at zoom-cache [1].  I've never used it myself, but it seems
 pretty nice.

 Cheers,

 [1] http://hackage.haskell.org/package/zoom-cache

Hi,

zoom-cache is useful for managing time-series data. There is a
zoom-cache-gnuplot in development, and it would probably be useful to
make a tool that uses Chart. I'm happy to help with that :)

Conrad.

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


Re: [Haskell-cafe] Drawing charts over a lot of data

2011-11-21 Thread Bryan O'Sullivan
On Mon, Nov 21, 2011 at 3:47 PM, Conrad Parker con...@metadecks.org wrote:


 zoom-cache is useful for managing time-series data. There is a
 zoom-cache-gnuplot in development, and it would probably be useful to
 make a tool that uses Chart. I'm happy to help with that :)


Be aware that Chart is pretty slow on large data sets.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ST not strict enough?

2011-11-21 Thread Ryan Ingram
On Fri, Nov 18, 2011 at 4:05 AM, Yves Parès limestr...@gmail.com wrote:

 (Sorry for the double mail)
 ...so there is no way to do that inside the function passed to modifySTRef?
 In other words, there is no way to ensure *inside* a function that its
 result will be evaluated strictly?


modifySTRef looks like this (sugared up a bit):

modifySTRef r f = do
x - readSTRef r
writeSTRef r (f x)

Note that this writes the *thunk* (f x) to the STRef, and there is
absolutely nothing you can do about it.  f isn't demanded by this
function, let alone f x.

You can implement your own strict modifySTRef' easily though, as other
people in this thread have shown.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] A Mascot

2011-11-21 Thread Richard O'Keefe

On 21/11/2011, at 9:22 PM, Karol Samborski wrote:

 Hi all,
 
 This is my sister's proposition:
 http://origami.bieszczady.pl/images/The_Lamb_Da.png
 
 What do you think?

It looks like a skittle with a baby bonnet.
C'est mignon, mais ce n'est pas la guerre
as Pierre Bosquet almost said.


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


Re: [Haskell-cafe] A Mascot

2011-11-21 Thread Carlos López Camey
 Yea, it's cute. I don't like the formula, though: \x - x + x is just too
 trivial and not very Haskellish. Something higher order is the minimum
 requirement, IMO. The original (lambda knights) formula was cool: the fixed
 point operator is directly related to recursion, which is reflected in the
 picture that contains itself; note also that defining this operator requires
 an untyped language, so this fits LISP quite well (but not Haskell).

I would go with something like ! forall A B. A - B, saying that type
casting under the C-H isomorphism is a lie and therefore we all must
avoid it :D, but I don't like the ! in front of it. Just my 2 cents.

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


Re: [Haskell-cafe] A Mascot

2011-11-21 Thread Jeremy Shaw
I think the artwork is nice, but I am not sure that a lamb is an
appropriate mascot for Haskell.

A mascot is supposed to represent characteristics, emotions, or
desires that a particular group of people aspire to have, be like,
etc. To outsiders, it provides a quick way to see if it might be a
group they would like to belong to, and for insiders, it helps
strengthen the bond and group identity by reminding them what they
stand for.

So far, the only justification I have noticed for why a lamb would
represent Haskell users is that there is a pun about lambda's -- which
only makes sense if you know English. Sheep are generally thought of
as:

 - weak and needing protection
 - easily lead astray
 - being lead to the slaughter
 - dumb and easily lost

Not sure those are traits that Haskeller's generally aspire to have.

I think Haskeller's like Haskell because it is:

 - elegant
 - sophisticated
 - reliable
 - robust

Haskeller's tend to be people who are curious. Pioneers who are
willing to go off the beaten path in search of something better.
People who are willing to evaluate something based on its merits
rather than the mere approval of the mainstream. People who aspire to
create elegant, beautiful code. People looking to better their skills,
even if they don't use Haskell for most of their coding. And there is
definitely a pragmatic aspect. Part of the appeal of Haskell is that
it can actually be used for many real world applications and can often
do the job better. The fact that you can use it to deliver more
reliable and robust code in less time, is a very real and tangible
benefit.

Here are some suggestions of my own. I am not really excited about any
of them either -- but they give some examples of how I think a mascot
might work:

 - owl: traditionally thought of as 'wise'. Known for their keen
(in)sight. Of course, some cultures believe they are a bad omen and a
sign of impending death..

 - honey badger - can't beat that for 'robust' and 'fearless',
http://www.youtube.com/watch?v=wPKlryXwmXk

 - james bond - he's sophisticated, reliable, and he does it with
'class'. hahah, more silly puns :p Of course, he is also not public
domain :) Plus, it is too male oriented.

In summary, a mascot is supposed to elicit an emotional response from
people and help create a bond. To do that, it needs to provide
emotional leadership and say that, if you use Haskell, you can be
like X. That doesn't it mean it can't be cute. People do tend to bond
easily to cute things (like kittens!). But I don't think cute is
enough. I also don't think that representing 'features' of Haskell,
like 'laziness' or 'higher order' is the right core appeal either.
That is too mental -- not enough emotion. Those things can, of course,
be represented in the depiction of the mascot. Nothing wrong with
cleverly hiding lamba's and _|_ in the picture. But, for example,
saying that Haskell is 'lazy' so we should pick a sloth, is not really
a good choice, IMO.

- jeremy



On Tue, Nov 15, 2011 at 7:01 PM, heathmatlock heathmatl...@gmail.com wrote:
 I liked Go's mascot, and I figure it couldn't hurt to have our own. I spent
 the past hour making this:
 http://i.imgur.com/Mib6Q.png

 What do you think?

 --
 Heath Matlock
 +1 256 274 4225

 ___
 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] A Mascot

2011-11-21 Thread serialhex
On Tue, Nov 22, 2011 at 12:22 AM, Jeremy Shaw jer...@n-heptane.com wrote:

  - honey badger - can't beat that for 'robust' and 'fearless',
 http://www.youtube.com/watch?v=wPKlryXwmXk


i think you were referring to this vid:
http://www.youtube.com/watch?v=m7pGZudN8rE (nsfw... almost)
i +1 a honey badger for haskell.  i'm a newb and it rocks!!
hex

-- 
*  my blog is cooler than yours: http://serialhex.github.com
*  The wise man said: Never argue with an idiot. They bring you down to
their level and beat you with experience.
*  As a programmer, it is your job to put yourself out of business. What
you do today can be automated tomorrow. ~Doug McIlroy
---
CFO: “What happens if we train people and they leave?”
CTO: “What if we don’t and they stay?”
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] FW: [Haskell] Job Opportunity at Parallel Scientific

2011-11-21 Thread Simon Peyton-Jones
I'm taking the liberty of forwarding this super-relevant advert to Haskell Cafe 
in case any readers read the Cafe but not the main Haskell mailing list.

Simon

From: haskell-boun...@haskell.org [mailto:haskell-boun...@haskell.org] On 
Behalf Of Peter Braam
Sent: 21 November 2011 22:23
To: haskell
Subject: [Haskell] Job Opportunity at Parallel Scientific

Parallel Haskell Programmers

Parallel Scientific, LLC is a Boulder, CO based early stage, but funded startup 
company working in the area of scalable parallelization for scientific and 
large data computing.  We are implementing radically new software tools for the 
creation and optimization of parallel programs benefiting applications and 
leveraging modern systems architecture. We build on our mathematical knowledge, 
cutting edge programming languages and our understanding of systems software 
and hardware.  We are currently working with the Haskell development team and 
major HPC laboratories world wide on libraries and compiler extensions for 
parallel programming.

Parallel Scientific was founded by Dr Peter Braam in 2010.  Peter formerly 
taught mathematics and computer science at Oxford and Carnegie Mellon.  Then he 
contributed file systems to Linux and invented Lustre (which provides storage 
to 9 of the top 10 systems in the world). He ran several successful startups, 
and Parallel Scientific is run by an very experienced management team and board.

Successful candidates can in some cases work remotely and will work in a modern 
virtual environment.  We provide training in advanced processes for software 
design and implementation and domain specific knowledge.

Required skills:

  *   Very strong background in computer science or mathematics
  *   Experience with Haskell
  *   Knowledge of systems programming and operating systems functionality
  *   Knowledge of system architectures, such as high performance networking, 
memory architectures, multi and manycore CPUs and GPGPUs
  *   Experience with performance tuning of parallel or concurrent algorithms
  *   Experience designing and implementing concurrent or parallel programs


Experience in one or more of the following areas is desirable:

  *   Experience with Haskell compiler technology
  *   In depth knowledge of core Haskell libraries for parallel programming 
(NDP, REPA etc)
  *   Experience in the area of middleware algorithms for data flow 
programming, graphs, cloud based data analytics, or sparse matrices
  *   Domain specific knowledge in scientific programming areas related to 
irregular and sparse problems, e.g. data analytics using graph analysis, 
genomics, tightly connected numerical analysis
  *   Experience with performance tuning for parallel applications on multi 
core systems (e.g. with the Intel toolkit), for GPGPU's using Cuda/OpenCL or 
with MPI/OpenMP on clusters of SMPs


To apply, please send a resume to j...@parsci.commailto:j...@parsci.com.
___
Haskell mailing list
hask...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe