Re: [Haskell-cafe] Deduce problem.

2011-11-16 Thread Magicloud Magiclouds
On Thu, Nov 17, 2011 at 1:17 PM, Brandon Allbery  wrote:
> On Wed, Nov 16, 2011 at 23:54, Magicloud Magiclouds
>  wrote:
>>
>> I think this is where I did not understand from the very beginning.
>> If the the declaration was correct, then why cannot b be H?
>> Referring to Data.List.genericLength, I was confused.
>
> Because it doesn't mean that *you* get to decide what it is; it means *the
> caller* gets to decide, and you are obligated to honor the caller's wishes.
>  Returning always an H violates this, because there is no way to prove that
> H is the only possible response.
> --
> brandon s allbery                                      allber...@gmail.com
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>
>

Ah, list and single value is a typo problem.

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?

-- 
竹密岂妨流水过
山高哪阻野云飞

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


Re: [Haskell-cafe] Deduce problem.

2011-11-16 Thread Brandon Allbery
On Wed, Nov 16, 2011 at 23:54, Magicloud Magiclouds <
magicloud.magiclo...@gmail.com> wrote:

> I think this is where I did not understand from the very beginning.
> If the the declaration was correct, then why cannot b be H?
> Referring to Data.List.genericLength, I was confused.


Because it doesn't mean that *you* get to decide what it is; it means *the
caller* gets to decide, and you are obligated to honor the caller's wishes.
 Returning always an H violates this, because there is no way to prove that
H is the only possible response.

-- 
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] Deduce problem.

2011-11-16 Thread MigMit
Of course, b can be H. The important question is: why can't it be something 
else? ClassC signature implies that b can be anything (of class ClassB) — not 
just H.

Another error is that you declare from as returning a list, but you try to 
implement it as returning a single value.

On 17 Nov 2011, at 08:54, Magicloud Magiclouds wrote:

> I think this is where I did not understand from the very beginning.
> If the the declaration was correct, then why cannot b be H?
> Referring to Data.List.genericLength, I was confused.
> 
> On Thu, Nov 17, 2011 at 12:34 PM, MigMit  wrote:
>> You've declared "from" as forall b. Test -> [b], but you're trying to 
>> implement it as Test -> H.
>> 
>> On 17 Nov 2011, at 07:48, Magicloud Magiclouds wrote:
>> 
>>> Hi,
>>>  Consider I have declarations like this:
>>> class (ClassA a) => ClassC a where
>>>  from :: (ClassB b) => a -> [b]
>>>  to :: (ClassB c) => a -> [c]
>>> 
>>> data H = ...
>>> 
>>> instance ClassB H where
>>>  ...
>>> 
>>> data Test = Test { m :: H }
>>> instance ClassA Test where
>>>  ...
>>> instance ClassC Test where
>>>  from = m
>>>  to = m
>>> 
>>>  Well, I got "could not deduce" error here at "from = m" and "to =
>>> m". `c' is a rigid type variable bound by the type signature for to ::
>>> ClassB c => Test -> [c].
>>>  Referring to some similar questions on internet, I should remove the
>>> (ClassB c) thing. Is this the only solution?
>>> --
>>> 竹密岂妨流水过
>>> 山高哪阻野云飞
>>> 
>>> ___
>>> 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] Deduce problem.

2011-11-16 Thread Magicloud Magiclouds
I think this is where I did not understand from the very beginning.
If the the declaration was correct, then why cannot b be H?
Referring to Data.List.genericLength, I was confused.

On Thu, Nov 17, 2011 at 12:34 PM, MigMit  wrote:
> You've declared "from" as forall b. Test -> [b], but you're trying to 
> implement it as Test -> H.
>
> On 17 Nov 2011, at 07:48, Magicloud Magiclouds wrote:
>
>> Hi,
>>  Consider I have declarations like this:
>> class (ClassA a) => ClassC a where
>>  from :: (ClassB b) => a -> [b]
>>  to :: (ClassB c) => a -> [c]
>>
>> data H = ...
>>
>> instance ClassB H where
>>  ...
>>
>> data Test = Test { m :: H }
>> instance ClassA Test where
>>  ...
>> instance ClassC Test where
>>  from = m
>>  to = m
>>
>>  Well, I got "could not deduce" error here at "from = m" and "to =
>> m". `c' is a rigid type variable bound by the type signature for to ::
>> ClassB c => Test -> [c].
>>  Referring to some similar questions on internet, I should remove the
>> (ClassB c) thing. Is this the only solution?
>> --
>> 竹密岂妨流水过
>> 山高哪阻野云飞
>>
>> ___
>> 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] Deduce problem.

2011-11-16 Thread MigMit
You've declared "from" as forall b. Test -> [b], but you're trying to implement 
it as Test -> H.

On 17 Nov 2011, at 07:48, Magicloud Magiclouds wrote:

> Hi,
>  Consider I have declarations like this:
> class (ClassA a) => ClassC a where
>  from :: (ClassB b) => a -> [b]
>  to :: (ClassB c) => a -> [c]
> 
> data H = ...
> 
> instance ClassB H where
>  ...
> 
> data Test = Test { m :: H }
> instance ClassA Test where
>  ...
> instance ClassC Test where
>  from = m
>  to = m
> 
>  Well, I got "could not deduce" error here at "from = m" and "to =
> m". `c' is a rigid type variable bound by the type signature for to ::
> ClassB c => Test -> [c].
>  Referring to some similar questions on internet, I should remove the
> (ClassB c) thing. Is this the only solution?
> -- 
> 竹密岂妨流水过
> 山高哪阻野云飞
> 
> ___
> 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] ANNOUNCE: graphviz-2999.12.0.4

2011-11-16 Thread Ivan Lazar Miljenovic
I've uploaded version 2999.12.0.4.

This release fixes the problem described by Max Rabkin below (who also
determined how to fix: I *always* get tripped up by asTypeOf :s).  It
also has improved documentation to help people that are wanting to
construct Dot graphs explicitly, and cleans up error messages produced
when provided Dot code isn't parseable (along with hints for common
solutions).

On 11 November 2011 02:19, Max Rabkin  wrote:
> My understanding of the documentation for Data.GraphViz.dotizeGraph
> and graphToGraph is that they should add position attributes to a
> graph. But they always seem to return graphs with empty attribute
> lists. What am I doing wrong in the following tiny example?
>
>> dotizeGraph nonClusteredParams (insNode (0, "Blah") $ empty :: Gr String ())
>
> 0:([],"Blah")->[]
>
> I expected the first list to contain at least a Pos attribute.
>
> I have written a wrapper around /usr/share/dot which shows the program
> is outputting positional information.
>
> --Max
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

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


Re: [Haskell-cafe] Deduce problem.

2011-11-16 Thread Magicloud Magiclouds
On Thu, Nov 17, 2011 at 11:48 AM, Magicloud Magiclouds
 wrote:
> Hi,
>  Consider I have declarations like this:
> class (ClassA a) => ClassC a where
>  from :: (ClassB b) => a -> [b]
>  to :: (ClassB c) => a -> [c]
>
> data H = ...
>
> instance ClassB H where
>  ...
>
> data Test = Test { m :: H }
> instance ClassA Test where
>  ...
> instance ClassC Test where
>  from = m
>  to = m
>
>  Well, I got "could not deduce" error here at "from = m" and "to =
> m". `c' is a rigid type variable bound by the type signature for to ::
> ClassB c => Test -> [c].
>  Referring to some similar questions on internet, I should remove the
> (ClassB c) thing. Is this the only solution?
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>

I was wrong, forall b. did not help

-- 
竹密岂妨流水过
山高哪阻野云飞

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


[Haskell-cafe] Deduce problem.

2011-11-16 Thread Magicloud Magiclouds
Hi,
  Consider I have declarations like this:
class (ClassA a) => ClassC a where
  from :: (ClassB b) => a -> [b]
  to :: (ClassB c) => a -> [c]

data H = ...

instance ClassB H where
  ...

data Test = Test { m :: H }
instance ClassA Test where
  ...
instance ClassC Test where
  from = m
  to = m

  Well, I got "could not deduce" error here at "from = m" and "to =
m". `c' is a rigid type variable bound by the type signature for to ::
ClassB c => Test -> [c].
  Referring to some similar questions on internet, I should remove the
(ClassB c) thing. Is this the only solution?
-- 
竹密岂妨流水过
山高哪阻野云飞

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread aditya siram
Wonder what they'd make of "bottom" :)

Maybe we can also incorporate some tongue-in-cheek tip-of-the-hat to
Shakespeare :
http://www.shakespearesantacruz.org/about/images/dream_34_thaler_web.jpg

-deech

On Wed, Nov 16, 2011 at 6:50 PM, Tom Murphy  wrote:

> I'm used to (on the east coast US) hearing lambda pronounced "LAM-duh."
> "Duh" is an expression of something being stupid, so I don't know about
> Haskell having a mascot called "Duh the Lamb"!
>
> amindfv / Tom
> On Nov 16, 2011 4:06 PM, "heathmatlock"  wrote:
>
>>
>>
>> On Wed, Nov 16, 2011 at 5:54 AM, Jerzy Karczmarczuk <
>> jerzy.karczmarc...@unicaen.fr> wrote:
>>
>>> Do you mind some ... how to say ... offside comments?
>>>
>>> 1. The Curry Da mascot looks like a penguin disguised as a  lamb. I have
>>> nothing against penguins !
>>>
>>
>> Hi Jerry, thanks for your input. The reason to have the the lamb standing
>> up is just so he can be dressed, and it does have similarities to a penguin
>> with its round belly, I suppose.
>>
>>>
>>> 2. Da, da, konech'no, mais, Signori und Demoiselles, do you realize that
>>> "lamb" is an English word, and we should think about our multilingual
>>> society. with our agneaux and other Karakuls. You will have problems with
>>> the translation of the mascot into German, and some may find some analogies
>>> with another image:
>>> http://www.chrisrusak.com/**images/11-013_small.jpg
>>> called  "Ein liebliches Lämmlein zu Tod" (after Des Knaben Wunderhorn,
>>> in the last part of Mahler 4th Symphony).
>>>
>>> 3. On the other hand, from the cultural point of view, this is a very
>>> good idea, and quite international, everybody knows Lamb Curry (Rogan Josh):
>>> http://www.route79.com/food/**rogan-josh.htm
>>>
>>>
>> Some might picture a symphony or what looks like newspaper origami when
>> they hear Da, and some might picture food when they hear Curry. I like Da
>> because its simple and "Da the lamb" rolls smoothly off the tongue.
>> Probably best to open a poll to and let everyone decide.
>>
>>
>> --
>> 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
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Weekly News: Issue 208

2011-11-16 Thread Daniel Santa Cruz
Welcome to issue 208 of the HWN, a newsletter covering developments in
the Haskell community. This release covers the week of November 6 to
12, 2011.

You can find the HTML version at:
http://contemplatecode.blogspot.com/2011/11/haskell-weekly-news-issue-208.html

New and Updated Projects

   * GHC (Ian Lynagh; 7.2.2) bugfix release for the 7.2 branch.
 [1] http://goo.gl/eB4X6

   * CoreErlang (Alex Kropivny; 0.0.2) New maintainer, plus some bug
 fixes.
 [2] http://goo.gl/TMUWs

   * virthualenv (Bartek ƒwik≈owski) A tool inspired by Python's
 virtualenv.
 [3] http://goo.gl/3Jvc0

   * transformers-base, transformers-abort, monad-abort-fd (Mikhail
 Vorozhtsov).
 [4] http://goo.gl/DRNgt

Quotes of the Week

   * Nimatek: People shouldn't be able to add two and two in Haskell
 without knowing monoids!

   * shachaf: Sometimes things are complicated because the domain is
 complicated. Other times things are complicated because edwardk.

   * shachaf: It's-a me, MonadIO!

   * elliott: a typeclass is nothing without semantics

   * Jafet: I didn't know what your question was so I answered the
 question that I liked

   * steakknife: Skip multidimensional types and go straight types that
 can express general relativity.

   * ddarius: "use the right platitude for the job"

   * balor: hmmdo not try to compile a file with a 30mb string in it

Top Reddit Stories

   * Quick poll: upvote if you think GHC should enable -O by default,
downvote if you think -O0 should continue to be the default
 Domain: self.haskell, Score: 68, Comments: 46
 On Reddit: [5] http://goo.gl/q43Ur
 Original: [6] http://goo.gl/q43Ur

   * What's going on with "id id id ... id 0"?
 Domain: self.haskell, Score: 46, Comments: 25
 On Reddit: [7] http://goo.gl/a57l0
 Original: [8] http://goo.gl/a57l0

   * HaskellDB: A long tutorial
 Domain: chrisdone.com, Score: 45, Comments: 6
 On Reddit: [9] http://goo.gl/FYBiU
 Original: [10] http://goo.gl/794G2

   * The Agda mailing list has the best questions [somewhat off topic]
 Domain: lists.chalmers.se, Score: 41, Comments: 1
 On Reddit: [11] http://goo.gl/ec5gB
 Original: [12] http://goo.gl/ODpKV

   * Virtual Haskell Environment
 Domain: paczesiowa.blogspot.com, Score: 40, Comments: 33
 On Reddit: [13] http://goo.gl/17qDB
 Original: [14] http://goo.gl/V7onW

   * Why doesn't Haskell's Prelude.read return a Maybe?
 Domain: stackoverflow.com, Score: 39, Comments: 44
 On Reddit: [15] http://goo.gl/vceL7
 Original: [16] http://goo.gl/ETu1j

   * First release of Kansas Lava
 Domain: ittc.ku.edu, Score: 32, Comments: 1
 On Reddit: [17] http://goo.gl/bj8vw
 Original: [18] http://goo.gl/nhAho

   * A major new release of the statistics library
 Domain: serpentine.com, Score: 28, Comments: 2
 On Reddit: [19] http://goo.gl/dYwQd
 Original: [20] http://goo.gl/7QkKY

   * TRYDSH - Test Your Code
 Domain: dbwiscam.informatik.uni-tuebingen.de, Score: 27, Comments: 3
 On Reddit: [21] http://goo.gl/qbZyA
 Original: [22] http://goo.gl/IiRf6

   * ScalableServer-0.1 - Providing an easy API for
attoparsec/enumerator/blaze based TCP services
 Domain: github.com, Score: 20, Comments: 14
 On Reddit: [23] http://goo.gl/aXqQ7
 Original: [24] http://goo.gl/Z1zcm

   * Python 3 Implementation in Haskell [x-post from programming.reddit.com]
 Domain: reddit.com, Score: 19, Comments: 0
 On Reddit: [25] http://goo.gl/lDJBr
 Original: [26] http://goo.gl/UrWld

   * let's derive Eq.(==) -- reflexivity not guaranteed
 Domain: self.haskell, Score: 16, Comments: 11
 On Reddit: [27] http://goo.gl/1ANU9
 Original: [28] http://goo.gl/1ANU9

   * Haskell and High-Performance Computing (HPC)
 Domain: self.haskell, Score: 16, Comments: 7
 On Reddit: [29] http://goo.gl/AZQPv
 Original: [30] http://goo.gl/AZQPv

Top StackOverflow Questions

   * Why doesn't Haskell's Prelude.read return a Maybe?
 votes: 29, answers: 4
 Read on SO: [31] http://goo.gl/ETu1j

   * Choosing between a class and a record
 votes: 27, answers: 3
 Read on SO: [32] http://goo.gl/Dn5FT

   * Function using foldr is too eager
 votes: 9, answers: 3
 Read on SO: [33] http://goo.gl/jUJxG

   * Odd results from monad transformer benchmark. A bug?
 votes: 9, answers: 2
 Read on SO: [34] http://goo.gl/qlvDj

   * Binary instance for an existential
 votes: 8, answers: 3
 Read on SO: [35] http://goo.gl/cHzhb

   * GHC Install Without Root
 votes: 7, answers: 2
 Read on SO: [36] http://goo.gl/mJnx5

   * Fixed point combinator in Haskell
 votes: 7, answers: 5
 Read on SO: [37] http://goo.gl/K4VcI

   * What's the best way to write facebook apps in haskell?
 votes: 6, answers: 1
 Read on SO: [38] http://goo.gl/HeXOp

   * Creating a list by cumulatively adding elements of another list: Haskell
 votes: 6, answer

Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Jason Dagit
You're quite the artist.  I wish I could make stuff like this.

Here are some more ideas (based on titles of papers about Haskell):
What about making the lamb wear a hair shirt?
http://research.microsoft.com/en-us/um/people/simonpj/papers/haskell-retrospective/

Or maybe it could be lazy with class?

Jason

On Wed, Nov 16, 2011 at 2:49 PM, heathmatlock wrote:

> On Wed, Nov 16, 2011 at 3:15 PM, Giovanni Tirloni 
> wrote:
>
>> On Wed, Nov 16, 2011 at 7:06 PM, heathmatlock wrote:
>>>
>>>
>>> Some might picture a symphony or what looks like newspaper origami when
>>> they hear Da, and some might picture food when they hear Curry. I like Da
>>> because its simple and "Da the lamb" rolls smoothly off the tongue.
>>> Probably best to open a poll to and let everyone decide.
>>>
>>>
>> Not trying to complicate things any further but perhaps it'd be better to
>> have a contest on this, just like for the new logo.
>>
>> --
>> Giovanni
>>
>>
>>
> You're probably right, I guess someone can create a new poll like the
> previous one:
>
>
> http://www.cs.cornell.edu/w8/~andru/cgi-perl/civs/results.pl?num_winners=1&id=E_d21b0256a4fd5ed7&algorithm=beatpath
>
> I took Jerzy's suggestions into consideration and made the lamb skinnier,
> maybe it looks less like a penguin now.
>
> http://imgur.com/4oeJz
>
> Thanks for the conversation so far, I'm glad there's interest in a mascot.
>
>
>
> --
> 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-16 Thread Tom Murphy
I'm used to (on the east coast US) hearing lambda pronounced "LAM-duh."
"Duh" is an expression of something being stupid, so I don't know about
Haskell having a mascot called "Duh the Lamb"!

amindfv / Tom
On Nov 16, 2011 4:06 PM, "heathmatlock"  wrote:

>
>
> On Wed, Nov 16, 2011 at 5:54 AM, Jerzy Karczmarczuk <
> jerzy.karczmarc...@unicaen.fr> wrote:
>
>> Do you mind some ... how to say ... offside comments?
>>
>> 1. The Curry Da mascot looks like a penguin disguised as a  lamb. I have
>> nothing against penguins !
>>
>
> Hi Jerry, thanks for your input. The reason to have the the lamb standing
> up is just so he can be dressed, and it does have similarities to a penguin
> with its round belly, I suppose.
>
>>
>> 2. Da, da, konech'no, mais, Signori und Demoiselles, do you realize that
>> "lamb" is an English word, and we should think about our multilingual
>> society. with our agneaux and other Karakuls. You will have problems with
>> the translation of the mascot into German, and some may find some analogies
>> with another image:
>> http://www.chrisrusak.com/**images/11-013_small.jpg
>> called  "Ein liebliches Lämmlein zu Tod" (after Des Knaben Wunderhorn, in
>> the last part of Mahler 4th Symphony).
>>
>> 3. On the other hand, from the cultural point of view, this is a very
>> good idea, and quite international, everybody knows Lamb Curry (Rogan Josh):
>> http://www.route79.com/food/**rogan-josh.htm
>>
>>
> Some might picture a symphony or what looks like newspaper origami when
> they hear Da, and some might picture food when they hear Curry. I like Da
> because its simple and "Da the lamb" rolls smoothly off the tongue.
> Probably best to open a poll to and let everyone decide.
>
>
> --
> 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] doctest: Interpreter exited with an error: ExitFailure 127

2011-11-16 Thread Simon Hengel
Hi Chris,

> i have upgraded to doctest version 0.4.1.
> Now when i try to run the example from the webpage, i get:
> 
> doctest: Interpreter exited with an error: ExitFailure 127
> 
> What's wrong here and how can i fix it?

Can you still reproduce this on your system?  If yes, I'd like to see if
we can do something about it (if only improving the error message).

Cheers,
Simon

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Hans Aberg
On 16 Nov 2011, at 23:49, heathmatlock wrote:

> I took Jerzy's suggestions into consideration and made the lamb skinnier, 
> maybe it looks less like a penguin now. 
> 
> http://imgur.com/4oeJz

A formula that is Haskell specific is
  \x -> ⊥ ≠ ⊥
It is mentioned in the Haskell 98 Report, sec. 6.2, "Strict Evaluation", p. 82. 
The LHS and RHS are different, because they can be distinguished by seq.

Hans



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


Re: [Haskell-cafe] Tutorial/slides on pretty-printing combinators?

2011-11-16 Thread Tony Sloane
On 17/11/2011, at 12:31 AM, Jerzy Karczmarczuk wrote:

> Sean Leather:
>> Do you know of any tutorial or slides from a talk on one of the 
>> pretty-printing libraries?
>> 
> Sean, if you need info just on Haskell solutions, other people will help you. 
> There is a paper:
> "Linear, bounded, functional pretty-printing" by Doaitse Swierstra and Olaf 
> Chitil (and "Pretty Printer with Lazy Deques" by Olaf, a Functional Pearl if 
> I am not mistaken). BTW, something has been implemented in Scala based on the 
> S. and C. approach.

Yes, our Scala port of the continuation-based version from Doaitse and Olaf's 
paper is in the Kiama library:

http://code.google.com/p/kiama
http://code.google.com/p/kiama/source/browse/src/org/kiama/util/PrettyPrinter.scala

Some brief slides from a short fpsyd talk on this part of Kiama are at 
http://code.google.com/p/kiama/wiki/Research.

regards,
Tony


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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread heathmatlock
On Wed, Nov 16, 2011 at 4:49 PM, heathmatlock wrote:

>
> You're probably right, I guess someone can create a new poll like the
> previous one:
>
>
> http://www.cs.cornell.edu/w8/~andru/cgi-perl/civs/results.pl?num_winners=1&id=E_d21b0256a4fd5ed7&algorithm=beatpath
>


I would create the poll for a mascot, but I think this is up to someone
else.

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

2011-11-16 Thread heathmatlock
On Wed, Nov 16, 2011 at 3:15 PM, Giovanni Tirloni wrote:

> On Wed, Nov 16, 2011 at 7:06 PM, heathmatlock wrote:
>>
>>
>> Some might picture a symphony or what looks like newspaper origami when
>> they hear Da, and some might picture food when they hear Curry. I like Da
>> because its simple and "Da the lamb" rolls smoothly off the tongue.
>> Probably best to open a poll to and let everyone decide.
>>
>>
> Not trying to complicate things any further but perhaps it'd be better to
> have a contest on this, just like for the new logo.
>
> --
> Giovanni
>
>
>
You're probably right, I guess someone can create a new poll like the
previous one:

http://www.cs.cornell.edu/w8/~andru/cgi-perl/civs/results.pl?num_winners=1&id=E_d21b0256a4fd5ed7&algorithm=beatpath

I took Jerzy's suggestions into consideration and made the lamb skinnier,
maybe it looks less like a penguin now.

http://imgur.com/4oeJz

Thanks for the conversation so far, I'm glad there's interest in a mascot.



-- 
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] ST not strict enough?

2011-11-16 Thread Johan Tibell
On Wed, Nov 16, 2011 at 2:23 PM, Jason Dusek  wrote:

> > Just double checked. modifySTRef is too lazy:
> > -- |Mutate the contents of an 'STRef'
> > modifySTRef :: STRef s a -> (a -> a) -> ST s ()
> > modifySTRef ref f = writeSTRef ref . f =<< readSTRef ref
> > We need Data.STRef.Strict
>
> Tried a modifySTRef' defined this way:
>
> modifySTRef' ref f   =  do
>  val   <-  (f $!!) <$> readSTRef ref
>  writeSTRef ref (val `seq` val)
>
> ...but there was no change in memory usage.


Why not just

modifySTRef :: STRef s a -> (a -> a) -> ST s ()
modifySTRef ref f = do
x <- readSTRef ref
writeSTRef ref $! f x

(Note that I didn't check if modifySTRef was actually a problem in this
case).

-- Johan
___
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-16 Thread Jason Dusek
2011/11/16 Johan Tibell :
> On Wed, Nov 16, 2011 at 12:07 PM, Johan Tibell  wrote:
>> +! doesn't work unless modifySTRef is already strict in the result of the
>> function application. You need to write modifySTRef' that seq:s the result
>> of the function application before calling writeSTRef.
>
> Just double checked. modifySTRef is too lazy:
> -- |Mutate the contents of an 'STRef'
> modifySTRef :: STRef s a -> (a -> a) -> ST s ()
> modifySTRef ref f = writeSTRef ref . f =<< readSTRef ref
> We need Data.STRef.Strict

Tried a modifySTRef' defined this way:

modifySTRef' ref f   =  do
  val   <-  (f $!!) <$> readSTRef ref
  writeSTRef ref (val `seq` val)

...but there was no change in memory usage.

--
Jason Dusek
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

___
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-16 Thread Daniel Fischer
On Wednesday 16 November 2011, 22:45:16, Johan Tibell wrote:
> On Wed, Nov 16, 2011 at 12:33 PM, Antoine Latter  
wrote:
> > We already have one in base - it re-exports Data.STRef in whole :-)
> > 
> > 
> > http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-STRef-
> > Strict.html
> 
> Then it's wrong. :( In what sense is it strict?

In the sense of Control.Monad.ST.Strict vs. Control.Monad.ST.Lazy

> I think it should be strict in the value stored in the ref.

Yes, we probably need that.

___
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-16 Thread Johan Tibell
On Wed, Nov 16, 2011 at 12:33 PM, Antoine Latter  wrote:

> We already have one in base - it re-exports Data.STRef in whole :-)
>
>
> http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-STRef-Strict.html


Then it's wrong. :( In what sense is it strict? I think it should be strict
in the value stored in the ref.

-- Johan
___
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-16 Thread tomberek
I ran into a similar problem with modifySTRef causing allocation and
GC. Creating my own strict version of modifySTRef got rid of all that
and my program ran without any allocation at all.

On Nov 16, 3:16 pm, Johan Tibell  wrote:
> On Wed, Nov 16, 2011 at 12:07 PM, Johan Tibell wrote:
>
>
>
>
>
>
>
>
>
> > On Wed, Nov 16, 2011 at 11:58 AM, Jason Dusek wrote:
>
> >> diff --git a/Rebuild.hs b/Rebuild.hs
> >> @@ -15,6 +15,7 @@ import Data.STRef
> >>  import Data.String
> >>  import Data.Word
>
> >> +import Control.DeepSeq
> >>  import Data.Vector.Unboxed (Vector)
> >>  import qualified Data.Vector.Unboxed as Vector (create, length)
> >>  import qualified Data.Vector.Unboxed.Mutable as Vector hiding (length)
> >> @@ -46,8 +47,8 @@ rebuildAsVector bytes        =  byteVector
> >>     n                       <-  readSTRef counter
> >>     return (Vector.unsafeSlice 0 n v)
> >>   writeOneByte v counter b   =  do n <- readSTRef counter
> >> -                                   Vector.unsafeWrite v n b
> >> +                                   w v n b
> >>                                    modifySTRef counter (+!1)
> >> +  (+!) a b                   =  ((+) $!! a) $!! b
> >> +  w v n b = (Vector.unsafeWrite v $!! n) $!! b
>
> > +! doesn't work unless modifySTRef is already strict in the result of the
> > function application. You need to write modifySTRef' that seq:s the result
> > of the function application before calling writeSTRef.
>
> Just double checked. modifySTRef is too lazy:
>
> -- |Mutate the contents of an 'STRef'
> modifySTRef :: STRef s a -> (a -> a) -> ST s ()
> modifySTRef ref f = writeSTRef ref . f =<< readSTRef ref
>
> We need Data.STRef.Strict
>
> ___
> Haskell-Cafe mailing list
> Haskell-C...@haskell.orghttp://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] Amazon AWS storage best to use with Haskell?

2011-11-16 Thread dokondr
Steve, thanks for sharing your experience with AWS!
At the moment I have evaluated several NoSQL storage solutions including
SimpleDB, Riak, MongoDB and Cassandra. Lessons learned:
1) Storage that SimpleDB provides is too low-level and not very convenient
to store dictionaries and other b-tree data structures that my app. works
with.
2) "simpledb/dev" simulator is out of date and does not support the
complete feature set of SimpleDB today. Thus, without major rewrite
"simpledb/dev" emulator can not be used for the development.
3) SimpleDB storage is 100% specific to Amazon framework. From this follows
that developing directly to SimpleDB interface will make app not portable
across different cloud platforms.
4) Cassandra row/column abstraction is awkward for Data.Map structures that
my app needs.
5) Riak provides convenient bucket/key/value abstraction and works in
robust to failure node framework. REST/JSON protocol is simple to use, yet
it is inefficient for data exchanges used by my app. I couldn't find simple
libraries for binary exchange that Riak also supports.
6) MongoDB answers my requirements best of all - it is powerful on a server
side (Javascript filters, etc) and works with efficient communication
protocol based on BSON data exchange.

I also plan to use RabitMQ  for communication between several Haskell
processes and Java Web front-end that my app incorporates.
It would be great to know what tools people use in the cloud (AWS, etc.) to
communicate Web front-end with rest of the (Haskell) system ?
What Haskell tools to build Web front-end?

Thanks!
Dmitri


On Wed, Nov 16, 2011 at 9:01 PM, Steve Severance wrote:

> We use AWS extensively. We use the aws package and have contributed to it,
> specifically SQS functionality. I will give you the rundown of what we do.
>
> We moved off of SimpleDb and now use mondodb. The reason is that simple db
> seemed to have problems with write pressure and there are not good tools
> for profiling your queries. My main application is extremely write heavy
> with a single instance needing to do 100s or 1000s of writes a second.
> Mongodb has worked well for us. I am scared of things like cassandra having
> looked at the code, however some people have made it work.
>
> We store data such as crawled web pages in S3. The files are lzma
> compressed and the data format is built on protocol buffers. We picked lzma
> for both storage costs of cold data and the fact that the pipe between S3
> and EC2 is somewhat limited and we want to make the most effective use of
> it as possible.
>
> In my experience AWS simulators are more trouble than they are worth since
> they don't accurately model the way AWS will respond to you under load. The
> free tier at AWS should allow you to experiment with building an app. The
> first couple of months of development cost us less than $1.
>
> Steve
>
> On Tue, Nov 1, 2011 at 1:27 AM, dokondr  wrote:
>
>>
>>
>> On Tue, Nov 1, 2011 at 10:53 AM, Neil Davies <
>> semanticphilosop...@gmail.com> wrote:
>>
>>> Word of caution
>>>
>>> Understand the semantics (and cost profile) of the AWS services first -
>>> you can't just open a HTTP connection and dribble data out over several
>>> days and hope for things to work. It is not a system that has that sort of
>>> laziness at its heart.
>>>
>>> AWS doesn't supply a traditional remote file store semantics - is
>>> queuing, simple database and object store have all been designed for large
>>> scale systems being offered as a service to a (potentially hostile) large
>>> set of users - you can see that in the way that things are designed. There
>>> are all sorts of (sensible from their point of view) performance related
>>> limits and retries.
>>>
>>> The challenge in designing nice clean layers on top of AWS is how/when
>>> to hide the transient/load related failures.
>>>
>>>
>>>
>> As a straw-man approach I would go first to NData.Map backed by Data.Map
>> with addition of "flush" function  to write Data.Map to external key-value
>> store / NoSQL DB.
>> Another requirement for NData.Map is concurrent consistency, so different
>> clients could modify its state preserving "happen-before" relationship. For
>> this I would add to NData.Map a "reftresh" function, that updates local
>> copy from  external key-value store.
>>
>> As for hSimpleDB package, it looks like it doesn't build on ghc7:
>> http://hackage.haskell.org/package/hSimpleDB
>>
>>
>>> The hSimpleDB package
>>>
>>> Interface to Amazon's SimpleDB service.
>>> PropertiesVersions0.1 ,
>>> 0.2 , *0.3*
>>> Dependenciesbase  (≥3
>>> & ≤4), bytestring,
>>> Crypto , 
>>> dataenc,
>>> HTTP , 
>>> hxt

Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Giovanni Tirloni
On Wed, Nov 16, 2011 at 7:06 PM, heathmatlock wrote:
>
>
> Some might picture a symphony or what looks like newspaper origami when
> they hear Da, and some might picture food when they hear Curry. I like Da
> because its simple and "Da the lamb" rolls smoothly off the tongue.
> Probably best to open a poll to and let everyone decide.
>
>
Not trying to complicate things any further but perhaps it'd be better to
have a contest on this, just like for the new logo.

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread heathmatlock
On Wed, Nov 16, 2011 at 5:54 AM, Jerzy Karczmarczuk <
jerzy.karczmarc...@unicaen.fr> wrote:

> Do you mind some ... how to say ... offside comments?
>
> 1. The Curry Da mascot looks like a penguin disguised as a  lamb. I have
> nothing against penguins !
>

Hi Jerry, thanks for your input. The reason to have the the lamb standing
up is just so he can be dressed, and it does have similarities to a penguin
with its round belly, I suppose.

>
> 2. Da, da, konech'no, mais, Signori und Demoiselles, do you realize that
> "lamb" is an English word, and we should think about our multilingual
> society. with our agneaux and other Karakuls. You will have problems with
> the translation of the mascot into German, and some may find some analogies
> with another image:
> http://www.chrisrusak.com/**images/11-013_small.jpg
> called  "Ein liebliches Lämmlein zu Tod" (after Des Knaben Wunderhorn, in
> the last part of Mahler 4th Symphony).
>
> 3. On the other hand, from the cultural point of view, this is a very good
> idea, and quite international, everybody knows Lamb Curry (Rogan Josh):
> http://www.route79.com/food/**rogan-josh.htm
>
>
Some might picture a symphony or what looks like newspaper origami when
they hear Da, and some might picture food when they hear Curry. I like Da
because its simple and "Da the lamb" rolls smoothly off the tongue.
Probably best to open a poll to and let everyone decide.


-- 
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] Tutorial/slides on pretty-printing combinators?

2011-11-16 Thread Stephen Tetley
Hi Sean

Doaiste Swierstra has fairly extensive notes on the development of the
attribute grammar versions of uulib's pretty printers.

The notes are called "Designing and Implementing Combinator
Languages". As they were a showcase for UUAG there is quite a lot on
attribute grammars in the notes, but the should be still be a good
source of inspiration.

___
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-16 Thread Antoine Latter
On Wed, Nov 16, 2011 at 2:16 PM, Johan Tibell  wrote:
> On Wed, Nov 16, 2011 at 12:07 PM, Johan Tibell 
> wrote:
>>
>> On Wed, Nov 16, 2011 at 11:58 AM, Jason Dusek 
>> wrote:
>>>
>>> diff --git a/Rebuild.hs b/Rebuild.hs
>>> @@ -15,6 +15,7 @@ import Data.STRef
>>>  import Data.String
>>>  import Data.Word
>>>
>>> +import Control.DeepSeq
>>>  import Data.Vector.Unboxed (Vector)
>>>  import qualified Data.Vector.Unboxed as Vector (create, length)
>>>  import qualified Data.Vector.Unboxed.Mutable as Vector hiding (length)
>>> @@ -46,8 +47,8 @@ rebuildAsVector bytes        =  byteVector
>>>     n                       <-  readSTRef counter
>>>     return (Vector.unsafeSlice 0 n v)
>>>   writeOneByte v counter b   =  do n <- readSTRef counter
>>> -                                   Vector.unsafeWrite v n b
>>> +                                   w v n b
>>>                                    modifySTRef counter (+!1)
>>> +  (+!) a b                   =  ((+) $!! a) $!! b
>>> +  w v n b = (Vector.unsafeWrite v $!! n) $!! b
>>
>> +! doesn't work unless modifySTRef is already strict in the result of the
>> function application. You need to write modifySTRef' that seq:s the result
>> of the function application before calling writeSTRef.
>
> Just double checked. modifySTRef is too lazy:
> -- |Mutate the contents of an 'STRef'
> modifySTRef :: STRef s a -> (a -> a) -> ST s ()
> modifySTRef ref f = writeSTRef ref . f =<< readSTRef ref
> We need Data.STRef.Strict

We already have one in base - it re-exports Data.STRef in whole :-)

http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-STRef-Strict.html

Antoine

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Daniel Peebles
I like it!

On Wed, Nov 16, 2011 at 1:01 AM, heathmatlock 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] ST not strict enough?

2011-11-16 Thread Tristan Ravitch
On Wed, Nov 16, 2011 at 12:16:34PM -0800, Johan Tibell wrote:
> Just double checked. modifySTRef is too lazy:
>
> -- |Mutate the contents of an 'STRef'
> modifySTRef :: STRef s a -> (a -> a) -> ST s ()
> modifySTRef ref f = writeSTRef ref . f =<< readSTRef ref
>
> We need Data.STRef.Strict

That would be awesome


pgpdezso7tDNs.pgp
Description: PGP signature
___
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-16 Thread Johan Tibell
On Wed, Nov 16, 2011 at 12:07 PM, Johan Tibell wrote:

> On Wed, Nov 16, 2011 at 11:58 AM, Jason Dusek wrote:
>
>> diff --git a/Rebuild.hs b/Rebuild.hs
>> @@ -15,6 +15,7 @@ import Data.STRef
>>  import Data.String
>>  import Data.Word
>>
>> +import Control.DeepSeq
>>  import Data.Vector.Unboxed (Vector)
>>  import qualified Data.Vector.Unboxed as Vector (create, length)
>>  import qualified Data.Vector.Unboxed.Mutable as Vector hiding (length)
>> @@ -46,8 +47,8 @@ rebuildAsVector bytes=  byteVector
>> n   <-  readSTRef counter
>> return (Vector.unsafeSlice 0 n v)
>>   writeOneByte v counter b   =  do n <- readSTRef counter
>> -   Vector.unsafeWrite v n b
>> +   w v n b
>>modifySTRef counter (+!1)
>> +  (+!) a b   =  ((+) $!! a) $!! b
>> +  w v n b = (Vector.unsafeWrite v $!! n) $!! b
>>
>
> +! doesn't work unless modifySTRef is already strict in the result of the
> function application. You need to write modifySTRef' that seq:s the result
> of the function application before calling writeSTRef.
>

Just double checked. modifySTRef is too lazy:

-- |Mutate the contents of an 'STRef'
modifySTRef :: STRef s a -> (a -> a) -> ST s ()
modifySTRef ref f = writeSTRef ref . f =<< readSTRef ref

We need Data.STRef.Strict
___
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-16 Thread Tristan Ravitch
On Wed, Nov 16, 2011 at 07:58:51PM +, Jason Dusek wrote:
> 2011/11/15 Johan Tibell :
> > On Tue, Nov 15, 2011 at 12:08 PM, Jason Dusek  wrote:
> >> Should I be annotating my functions with strictness, for the
> >> vector reference, for example? Should I be using STUArrays,
> >> instead?
> >
> > From
> > http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.4.1.0/Control-Monad-ST-Safe.html
> >
> >     "The >>= and >> operations are strict in the state (though not in values
> > stored in the state)."
> >
> > which implies that
> >
> >  modifySTRef counter (+1)
> >
> > is too lazy.
>
> As a first cut at strictifying the ST operations, I introduced a
> strict plus and strict vector write operation, strictifying
> every parameter that admitted it.
>
>   (+!) a b   =  ((+) $!! a) $!! b
>   w v n b = (Vector.unsafeWrite v $!! n) $!! b
>
> This did not alter memory usage in any noticeable way. (Tried it
> with strict and lazy ByteStrings and both had the same memory
> usage as they did without the extra strictness.)
>
> It does seem off odd that building a vector byte by byte is so
> hard to do performantly. Maybe the memory usage ends up being
> okay when working with larger structures, though.
>

I think your use of (+1) in the STRef was safe here because
unsafeWrite was forcing it relatively quickly.  The laziness in ST
values just bit me a few days ago because I wasn't forcing the values
soon enough and was getting stack overflows when evaluation was
finally triggered.

Have you tried building the vector using things besides write/ST?  It
might be a bit faster to use something like Vector.unfoldr or
Vector.generateM and ByteString.index to build up a pure Vector.
After that you could use Vector.unsafeThaw to convert that pure Vector
into an MVector.


pgpVHqvtAbBuh.pgp
Description: PGP signature
___
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-16 Thread Johan Tibell
On Wed, Nov 16, 2011 at 11:58 AM, Jason Dusek  wrote:

> diff --git a/Rebuild.hs b/Rebuild.hs
> @@ -15,6 +15,7 @@ import Data.STRef
>  import Data.String
>  import Data.Word
>
> +import Control.DeepSeq
>  import Data.Vector.Unboxed (Vector)
>  import qualified Data.Vector.Unboxed as Vector (create, length)
>  import qualified Data.Vector.Unboxed.Mutable as Vector hiding (length)
> @@ -46,8 +47,8 @@ rebuildAsVector bytes=  byteVector
> n   <-  readSTRef counter
> return (Vector.unsafeSlice 0 n v)
>   writeOneByte v counter b   =  do n <- readSTRef counter
> -   Vector.unsafeWrite v n b
> +   w v n b
>modifySTRef counter (+!1)
> +  (+!) a b   =  ((+) $!! a) $!! b
> +  w v n b = (Vector.unsafeWrite v $!! n) $!! b
>

+! doesn't work unless modifySTRef is already strict in the result of the
function application. You need to write modifySTRef' that seq:s the result
of the function application before calling writeSTRef.

-- Johan
___
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-16 Thread Jason Dusek
2011/11/15 Johan Tibell :
> On Tue, Nov 15, 2011 at 12:08 PM, Jason Dusek  wrote:
>> Should I be annotating my functions with strictness, for the
>> vector reference, for example? Should I be using STUArrays,
>> instead?
>
> From
> http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.4.1.0/Control-Monad-ST-Safe.html
>
>     "The >>= and >> operations are strict in the state (though not in values
> stored in the state)."
>
> which implies that
>
>  modifySTRef counter (+1)
>
> is too lazy.

As a first cut at strictifying the ST operations, I introduced a
strict plus and strict vector write operation, strictifying
every parameter that admitted it.

  (+!) a b   =  ((+) $!! a) $!! b
  w v n b = (Vector.unsafeWrite v $!! n) $!! b

This did not alter memory usage in any noticeable way. (Tried it
with strict and lazy ByteStrings and both had the same memory
usage as they did without the extra strictness.)

It does seem off odd that building a vector byte by byte is so
hard to do performantly. Maybe the memory usage ends up being
okay when working with larger structures, though.

--
Jason Dusek
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments




diff --git a/Rebuild.hs b/Rebuild.hs
@@ -15,6 +15,7 @@ import Data.STRef
 import Data.String
 import Data.Word

+import Control.DeepSeq
 import Data.Vector.Unboxed (Vector)
 import qualified Data.Vector.Unboxed as Vector (create, length)
 import qualified Data.Vector.Unboxed.Mutable as Vector hiding (length)
@@ -46,8 +47,8 @@ rebuildAsVector bytes=  byteVector
 n   <-  readSTRef counter
 return (Vector.unsafeSlice 0 n v)
   writeOneByte v counter b   =  do n <- readSTRef counter
-   Vector.unsafeWrite v n b
+   w v n b
modifySTRef counter (+!1)
+  (+!) a b   =  ((+) $!! a) $!! b
+  w v n b = (Vector.unsafeWrite v $!! n) $!! b

___
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-16 Thread Jason Dusek
2011/11/15 Roman Cheplyaka :
> * Jason Dusek  [2011-11-15 20:08:48+]
>> I'm having some trouble with memory usage in rebuilding a
>> ByteString with some sequences escaped. I thought I'd try
>> vectors. However, it seems that even a relatively simple
>> function, one that places all the bytes of a ByteString in to a
>> vector, uses a great deal of memory.
>
> I think what's happening here is ByteString's "strictness" makes things
> actually lazy on your side.
>
> Namely, unpack function produces its result "strictly", whole list at
> once. As a result, the resulting list cannot be consumed one-by-one,
> so it takes memory. You see ST thunks because
>
>  mapM_ f as =  sequence_ (map f as)
>
> and that map probably gets fused with unpack.
>
> I guess the proper solution here is to use lazy bytestring and make sure
> the chunks are not very big.

Hi Roman,

Switching to the lazy ByteStrings API does, indeed, help; total
memory usage is around 16M. I will have a look at the rules that
are fired to see what I can learn.

--
Jason Dusek
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

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


Re: [Haskell-cafe] Amazon AWS storage best to use with Haskell?

2011-11-16 Thread Steve Severance
We use AWS extensively. We use the aws package and have contributed to it,
specifically SQS functionality. I will give you the rundown of what we do.

We moved off of SimpleDb and now use mondodb. The reason is that simple db
seemed to have problems with write pressure and there are not good tools
for profiling your queries. My main application is extremely write heavy
with a single instance needing to do 100s or 1000s of writes a second.
Mongodb has worked well for us. I am scared of things like cassandra having
looked at the code, however some people have made it work.

We store data such as crawled web pages in S3. The files are lzma
compressed and the data format is built on protocol buffers. We picked lzma
for both storage costs of cold data and the fact that the pipe between S3
and EC2 is somewhat limited and we want to make the most effective use of
it as possible.

In my experience AWS simulators are more trouble than they are worth since
they don't accurately model the way AWS will respond to you under load. The
free tier at AWS should allow you to experiment with building an app. The
first couple of months of development cost us less than $1.

Steve

On Tue, Nov 1, 2011 at 1:27 AM, dokondr  wrote:

>
>
> On Tue, Nov 1, 2011 at 10:53 AM, Neil Davies <
> semanticphilosop...@gmail.com> wrote:
>
>> Word of caution
>>
>> Understand the semantics (and cost profile) of the AWS services first -
>> you can't just open a HTTP connection and dribble data out over several
>> days and hope for things to work. It is not a system that has that sort of
>> laziness at its heart.
>>
>> AWS doesn't supply a traditional remote file store semantics - is
>> queuing, simple database and object store have all been designed for large
>> scale systems being offered as a service to a (potentially hostile) large
>> set of users - you can see that in the way that things are designed. There
>> are all sorts of (sensible from their point of view) performance related
>> limits and retries.
>>
>> The challenge in designing nice clean layers on top of AWS is how/when to
>> hide the transient/load related failures.
>>
>>
>>
> As a straw-man approach I would go first to NData.Map backed by Data.Map
> with addition of "flush" function  to write Data.Map to external key-value
> store / NoSQL DB.
> Another requirement for NData.Map is concurrent consistency, so different
> clients could modify its state preserving "happen-before" relationship. For
> this I would add to NData.Map a "reftresh" function, that updates local
> copy from  external key-value store.
>
> As for hSimpleDB package, it looks like it doesn't build on ghc7:
> http://hackage.haskell.org/package/hSimpleDB
>
>
>> The hSimpleDB package
>>
>> Interface to Amazon's SimpleDB service.
>> PropertiesVersions0.1 ,
>> 0.2 , *0.3*
>> Dependenciesbase  (≥3 &
>> ≤4), bytestring ,
>> Crypto , 
>> dataenc,
>> HTTP , 
>> hxt,
>> network , 
>> old-locale,
>> old-time ,
>> utf8-string 
>> LicenseBSD3AuthorDavid Himmelstrup 2009, Greg Heartsfield 2007Maintainer 
>> David
>> Himmelstrup 
>> CategoryDatabase,
>> Web ,
>> Network
>>  Upload
>> dateThu Sep 17 17:09:26 UTC 2009Uploaded byDavidHimmelstrupBuilt on ghc-6.10,
>> ghc-6.12Build failureghc-7.0 
>> (log
>> )
>>
>
>
> ___
> 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] [Haskell] Dutch National FP Day 2012

2011-11-16 Thread Sean Leather
>
> > What is the language of the talks and the participants? English or Dutch?
>
> In past years the language of the talks has always been English. Also,
> most Dutch people speak English pretty well, I think.


Yes, what Erik said. Also, even though previous years' websites (below)
have been in Dutch, most (perhaps all) talking has been in English.

http://www.staff.science.uu.nl/~jeuri101/Meetings/FPDag2008/
http://www.win.tue.nl/~japie/FP-dag-2009/programma.htm
http://wiki.clean.cs.ru.nl/NL-FP_dag_2010

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


Re: [Haskell-cafe] [Haskell] Dutch National FP Day 2012

2011-11-16 Thread Erik Hesselink
On Wed, Nov 16, 2011 at 16:19, Henning Thielemann
 wrote:
>
> On Wed, 16 Nov 2011, Sean Leather wrote:
>
>> (Sent on behalf of Doaitse Swierstra)
>>
>> Despite some last minute changes to the planning we are happy to announce
>> that the next
>> Dutch functional programming day will take place on January 6, 2012, at
>> the university
>> campus "De Uithof" of Utrecht University.
>>
>> In case you want to give a presentation please send title, speaker and
>> abstract to
>> doai...@swierstra.net before Dec 1.
>
> What is the language of the talks and the participants? English or Dutch?

In past years the language of the talks has always been English. Also,
most Dutch people speak English pretty well, I think.

Erik

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


Re: [Haskell-cafe] [Haskell] Dutch National FP Day 2012

2011-11-16 Thread Henning Thielemann


On Wed, 16 Nov 2011, Sean Leather wrote:


(Sent on behalf of Doaitse Swierstra)

Despite some last minute changes to the planning we are happy to announce that 
the next
Dutch functional programming day will take place on January 6, 2012, at the 
university
campus "De Uithof" of Utrecht University.

In case you want to give a presentation please send title, speaker and abstract 
to
doai...@swierstra.net before Dec 1.


What is the language of the talks and the participants? English or Dutch?

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


[Haskell-cafe] Dutch National FP Day 2012

2011-11-16 Thread Sean Leather
(Sent on behalf of Doaitse Swierstra)

Despite some last minute changes to the planning we are happy to announce
that the next Dutch functional programming day will take place on January
6, 2012, at the university campus "De Uithof" of Utrecht University.

In case you want to give a presentation please send title, speaker and
abstract to doai...@swierstra.net before Dec 1.

We will collect the proposals and try to make an interesting program out of
it.

Further details will be placed on the site:
http://www.cs.uu.nl/wiki/FPDag2012

Best, hoping to see you all,
Doaitse
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Tutorial/slides on pretty-printing combinators?

2011-11-16 Thread Jerzy Karczmarczuk

Sean Leather:
Do you know of any tutorial or slides from a talk on one of the 
pretty-printing libraries?


Sean, if you need info just on Haskell solutions, other people will help 
you. There is a paper:
"Linear, bounded, functional pretty-printing" by Doaitse Swierstra and 
Olaf Chitil (and "Pretty Printer with Lazy Deques" by Olaf, a Functional 
Pearl if I am not mistaken). BTW, something has been implemented in 
Scala based on the S. and C. approach.


So don't forget about other languages, you may learn something also here:

http://caml.inria.fr/pub/docs/manual-ocaml/manual003.html#toc11

OK, these are not slides...

Jerzy Karczmarczuk


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


[Haskell-cafe] Tutorial/slides on pretty-printing combinators?

2011-11-16 Thread Sean Leather
Do you know of any tutorial or slides from a talk on one of the
pretty-printing libraries? It could be on Text.PrettyPrint.HughesPJ or
uulib or any other, similar library.

I'm thinking of developing slides for a course, and I'm looking for sources
of inspiration.

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread MigMit
You're probably missing the fact that it's much harder to understand how the 
Haskell program works without (_|_). I've seen lots of questions like "why 
doesn't my recursion work" that could be answered simply as "because your 
function is strict, so (_|_) is it's minimal fixpoint".

Отправлено с iPhone

Nov 16, 2011, в 15:31, Jesse Schalken  написал(а):

> I like the idea of a mascot. I like the idea of a lamb called Da, as most of 
> Haskell's strength comes from it's closeness to pure lambda calculus.
> 
> A few things I'd like to see in a mascot:
> - Simple. You should be able to draw it in a few seconds.
> - Look good in black and white.
> - Have obvious features so it is identifiable from a distance.
> - Be a little bit cute.
> 
> I don't see why ⊥ has to be featured. ⊥ means a computation can terminate 
> without returning a value. That is a flaw, not a strength. If a computation 
> may fail, return a Maybe or Either String. If a computation might not 
> terminate, let it not terminate and I can find out why with my debugger. That 
> covers all the use cases of ⊥. It also undermines the type system as 
> beginners often write functions which return ⊥ where they should either be 
> returning a Maybe or Either String, or expressing the violated precondition 
> in the type system so it can be tested at compile time. What am I missing?
> 
> On Wed, Nov 16, 2011 at 9:47 PM, Bas van Dijk  wrote:
> On 16 November 2011 11:05, MigMit  wrote:
> > Maybe it's just me, but I've thought that being non-strict just means that 
> > it's possible for a function to produce some value even if it's argument 
> > doesn't; in other words, that it's possible to have "f (_|_) ≠ (_|_)". If 
> > there was no such thing as (_|_), what would non-strictness mean?
> 
> Thanks, non-strictness is indeed defined using ⊥ like you mentioned.
> 
> I think I was confusing non-strict evaluation with coinduction. They
> have the same advantages but the latter is less powerful but safer
> than the former.
> 
> Bas
> 
> ___
> 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 mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Jerzy Karczmarczuk

Do you mind some ... how to say ... offside comments?

1. The Curry Da mascot looks like a penguin disguised as a  lamb. I have 
nothing against penguins !


2. Da, da, konech'no, mais, Signori und Demoiselles, do you realize that 
"lamb" is an English word, and we should think about our multilingual 
society. with our agneaux and other Karakuls. You will have problems 
with the translation of the mascot into German, and some may find some 
analogies with another image:

http://www.chrisrusak.com/images/11-013_small.jpg
called  "Ein liebliches Lämmlein zu Tod" (after Des Knaben Wunderhorn, 
in the last part of Mahler 4th Symphony).


3. On the other hand, from the cultural point of view, this is a very 
good idea, and quite international, everybody knows Lamb Curry (Rogan Josh):

http://www.route79.com/food/rogan-josh.htm

4. It is incredible, how this mascot inspired a long, long discussion 
about the Bottom. Now, Bottom is important ! Most French politicians 
speak only about that (well, at least one of them doesn't speak, but 
prefers practical exercises...), but I confess that I am a little lost. 
Anyway, I learned something.

For example, that what is strictly forbidden, is lazily allowed.

Best regards

Jerzy Karczmarczuk
Caen, France.
(25 km from the Oldest Comic Strip in the World, 1000 years and progressing)


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


Re: [Haskell-cafe] How to Create Programming Language with Haskell?

2011-11-16 Thread Ahn, Ki Yung
Don't think this is what Shogo is looking for since the book is not 
about implementing a language WITH Haskell, but how to implement Haskell 
like languages with a more low level language (like C).


2011년 11월 16일 00:13, Anton Kholomiov 쓴 글:

This can be very helpful: Implementation of FP languages by Simon Peyton
Jones

http://research.microsoft.com/en-us/um/people/simonpj/papers/slpj-book-1987/index.htm



2011/11/16 Shogo Sugamoto mailto:eseh...@gmail.com>>

Hi,Cafe.

I want to create my own Programming Language with Haskell, and I learn
how to do it.
I read:

WikiBooks of "Write Yourself a Scheme in 48 Hours",
"Real World Haskell" of Chapter "Using Parsec",
Source of "HJS",
Book of "Introduction of Functional Programming Using Haskell".

Ok,What is another good source creating my own Programming Language
with Haskell?
Thanks :)

esehara

___
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 mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Jesse Schalken
I like the idea of a mascot. I like the idea of a lamb called Da, as most
of Haskell's strength comes from it's closeness to pure lambda calculus.

A few things I'd like to see in a mascot:
- Simple. You should be able to draw it in a few seconds.
- Look good in black and white.
- Have obvious features so it is identifiable from a distance.
- Be a little bit cute.

I don't see why ⊥ has to be featured. ⊥ means a computation can terminate
without returning a value. That is a flaw, not a strength. If a computation
may fail, return a Maybe or Either String. If a computation might not
terminate, let it not terminate and I can find out why with my debugger.
That covers all the use cases of ⊥. It also undermines the type system as
beginners often write functions which return ⊥ where they should either be
returning a Maybe or Either String, or expressing the violated precondition
in the type system so it can be tested at compile time. What am I missing?

On Wed, Nov 16, 2011 at 9:47 PM, Bas van Dijk  wrote:

> On 16 November 2011 11:05, MigMit  wrote:
> > Maybe it's just me, but I've thought that being non-strict just means
> that it's possible for a function to produce some value even if it's
> argument doesn't; in other words, that it's possible to have "f (_|_) ≠
> (_|_)". If there was no such thing as (_|_), what would non-strictness mean?
>
> Thanks, non-strictness is indeed defined using ⊥ like you mentioned.
>
> I think I was confusing non-strict evaluation with coinduction. They
> have the same advantages but the latter is less powerful but safer
> than the former.
>
> Bas
>
> ___
> 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-16 Thread Bas van Dijk
On 16 November 2011 11:05, MigMit  wrote:
> Maybe it's just me, but I've thought that being non-strict just means that 
> it's possible for a function to produce some value even if it's argument 
> doesn't; in other words, that it's possible to have "f (_|_) ≠ (_|_)". If 
> there was no such thing as (_|_), what would non-strictness mean?

Thanks, non-strictness is indeed defined using ⊥ like you mentioned.

I think I was confusing non-strict evaluation with coinduction. They
have the same advantages but the latter is less powerful but safer
than the former.

Bas

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Vincent Hanquez

On 11/16/2011 01:01 AM, heathmatlock 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

awesome. It's really nice,

--
Vincent

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Tillmann Vogt

Am 16.11.2011 10:07, schrieb Andrew Butterfield:

On 16 Nov 2011, at 08:46, Ertugrul Soeylemez wrote:


But I think, despite the well-founded denotational semantics of Haskell,
bottom does not play that much of a role.

There is one? Where? Last time I looked (a while ago, admittedly)
there was no denotational (or any formal) semantics for Haskell.
  - lots of stuff for fragments of Haskell-like languages or parts of Haskell, 
but not a
full proper definitive semantics for *Haskell*, as found in the wild...

Looking at
  http://en.wikibooks.org/wiki/Haskell/Denotational_semantics
the first footnote states
   "In fact, there are no written down and complete denotational semantics of 
Haskell. This would be a tedious task void of additional insight and we happily embrace 
the folklore and common sense semantics."

However, if you have a proof-based tool used for reasoning about Haskell 
programs
in a safety-critical environment, you might just need to do this tedious task,
particularly in order to show your proof rules sound.
  - has anyone in that area done this? is it available ?

Is there a definitive Operational Semantics? Axiomatic?


http://verify.rwth-aachen.de/fp09
The lecture is about reducing (simple) Haskell to the lambda calculus 
(denotational semantics) and then showing the operational semantics of 
the untyped lambda calculus.
It is amazing that a practical language can be reduced to the lambda 
calculus so easily. It made me into a Haskell programmer.
They also use this practically in a Java tool to prove termination of 
Haskell programs.
It is mentioned in the last hcar under "Automated Termination Analyzer 
for Haskell".



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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread MigMit
Maybe it's just me, but I've thought that being non-strict just means that it's 
possible for a function to produce some value even if it's argument doesn't; in 
other words, that it's possible to have "f (_|_) ≠ (_|_)". If there was no such 
thing as (_|_), what would non-strictness mean?

On 16 Nov 2011, at 13:46, Bas van Dijk wrote:

> On 16 November 2011 05:18, John Meacham  wrote:
>> Not nearly enough
>> attention is paid to the other striking feature, the laziness. The
>> 'bottom' symbol _|_ should feature prominently. The two most defining
>> features of haskell are that it is purely functional and _|_ inhabits
>> every type. The combination of which is very powerful.
> 
> Is ⊥ the right symbol to express the non-strict evaluation of the
> language? Is it true that non-strict evaluation requires that ⊥
> inhabits every type? In other words: why can't there exist a
> non-strict total language (probably having some form of coinductive
> types)?
> 
> Cheers,
> 
> Bas
> 
> ___
> 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-16 Thread Bas van Dijk
On 16 November 2011 05:18, John Meacham  wrote:
> Not nearly enough
> attention is paid to the other striking feature, the laziness. The
> 'bottom' symbol _|_ should feature prominently. The two most defining
> features of haskell are that it is purely functional and _|_ inhabits
> every type. The combination of which is very powerful.

Is ⊥ the right symbol to express the non-strict evaluation of the
language? Is it true that non-strict evaluation requires that ⊥
inhabits every type? In other words: why can't there exist a
non-strict total language (probably having some form of coinductive
types)?

Cheers,

Bas

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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread MigMit
The fact that nobody bothered to write one down doesn't mean there isn't one.

Отправлено с iPhone

Nov 16, 2011, в 13:07, Andrew Butterfield  
написал(а):

> 
> On 16 Nov 2011, at 08:46, Ertugrul Soeylemez wrote:
> 
>> 
>> But I think, despite the well-founded denotational semantics of Haskell,
>> bottom does not play that much of a role.
> 
> There is one? Where? Last time I looked (a while ago, admittedly)
> there was no denotational (or any formal) semantics for Haskell.
> - lots of stuff for fragments of Haskell-like languages or parts of Haskell, 
> but not a 
> full proper definitive semantics for *Haskell*, as found in the wild... 
> 
> Looking at
> http://en.wikibooks.org/wiki/Haskell/Denotational_semantics
> the first footnote states
>  "In fact, there are no written down and complete denotational semantics of 
> Haskell. This would be a tedious task void of additional insight and we 
> happily embrace the folklore and common sense semantics."
> 
> However, if you have a proof-based tool used for reasoning about Haskell 
> programs
> in a safety-critical environment, you might just need to do this tedious task,
> particularly in order to show your proof rules sound.
> - has anyone in that area done this? is it available ?
> 
> Is there a definitive Operational Semantics? Axiomatic?
> 
> PS - I love the mascot - thanks Heath !
>> 
>> 
>> Greets,
>> Ertugrul
>> 
>> 
>> -- 
>> nightmare = unsafePerformIO (getWrongWife >>= sex)
>> http://ertes.de/
>> 
>> 
>> 
>> ___
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 
> Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
> Lero@TCD, Head of Foundations & Methods Research Group
> Director of Teaching and Learning - Undergraduate,
> School of Computer Science and Statistics,
> Room G.39, O'Reilly Institute, Trinity College, University of Dublin
>  http://www.scss.tcd.ie/Andrew.Butterfield/
> 
> 
> 
> ___
> 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-16 Thread Andrew Butterfield

On 16 Nov 2011, at 08:46, Ertugrul Soeylemez wrote:

> 
> But I think, despite the well-founded denotational semantics of Haskell,
> bottom does not play that much of a role.

There is one? Where? Last time I looked (a while ago, admittedly)
there was no denotational (or any formal) semantics for Haskell.
 - lots of stuff for fragments of Haskell-like languages or parts of Haskell, 
but not a 
full proper definitive semantics for *Haskell*, as found in the wild... 

Looking at
 http://en.wikibooks.org/wiki/Haskell/Denotational_semantics
the first footnote states
  "In fact, there are no written down and complete denotational semantics of 
Haskell. This would be a tedious task void of additional insight and we happily 
embrace the folklore and common sense semantics."

However, if you have a proof-based tool used for reasoning about Haskell 
programs
in a safety-critical environment, you might just need to do this tedious task,
particularly in order to show your proof rules sound.
 - has anyone in that area done this? is it available ?

Is there a definitive Operational Semantics? Axiomatic?

PS - I love the mascot - thanks Heath !
> 
> 
> Greets,
> Ertugrul
> 
> 
> -- 
> nightmare = unsafePerformIO (getWrongWife >>= sex)
> http://ertes.de/
> 
> 
> 
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
Lero@TCD, Head of Foundations & Methods Research Group
Director of Teaching and Learning - Undergraduate,
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
  http://www.scss.tcd.ie/Andrew.Butterfield/



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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Hans Aberg
On 16 Nov 2011, at 05:18, John Meacham wrote:

> People tend to concentrate on the lambda which cooresponds to the
> functional aspect of haskell when designing logos. Not nearly enough
> attention is paid to the other striking feature, the laziness. The
> 'bottom' symbol _|_ should feature prominently. The two most defining
> features of haskell are that it is purely functional and _|_ inhabits
> every type. The combination of which is very powerful.

The mascot already represents the lambda, so all that is needed is to show off 
its _|_.

Hans



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


Re: [Haskell-cafe] Is SmallCheck maintained?

2011-11-16 Thread Erik de Castro Lopo
wren ng thornton wrote:

> I don't know whether it's being maintained either, but I'm willing to 
> help with the janitorial work since I use smallcheck and lazy-smallcheck 
> quite a lot and think they should be better advertised/used.

Hi Wren,

Sounds like a job for the haskell-pkg-janitors group:

https://github.com/haskell-pkg-janitors/

Feel free to join in.

Cheers,
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] A Mascot

2011-11-16 Thread Ertugrul Soeylemez
John Meacham  wrote:

> People tend to concentrate on the lambda which cooresponds to the
> functional aspect of haskell when designing logos. Not nearly enough
> attention is paid to the other striking feature, the laziness. The
> 'bottom' symbol _|_ should feature prominently. The two most defining
> features of haskell are that it is purely functional and _|_ inhabits
> every type. The combination of which is very powerful.

I like the idea, even though personally I don't care that much.

I think the phrase "being lazy with class" could be put into the design
of a mascot.  For Haskell (forgive me for that term) marketing purposes
a mascot would definitely help.

But I think, despite the well-founded denotational semantics of Haskell,
bottom does not play that much of a role.


Greets,
Ertugrul


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



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


Re: [Haskell-cafe] A Mascot

2011-11-16 Thread Diego Olivier Fernandez Pons
>
> People tend to concentrate on the lambda which cooresponds to the
> functional aspect of haskell when designing logos. Not nearly enough
> attention is paid to the other striking feature, the laziness. The
> 'bottom' symbol _|_ should feature prominently. The two most defining
> features of haskell are that it is purely functional and _|_ inhabits
> every type. The combination of which is very powerful.
>

Yeah, but Lamb Bottom doesn't work.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How to Create Programming Language with Haskell?

2011-11-16 Thread Anton Kholomiov
This can be very helpful: Implementation of FP languages by Simon Peyton
Jones

http://research.microsoft.com/en-us/um/people/simonpj/papers/slpj-book-1987/index.htm



2011/11/16 Shogo Sugamoto 

> Hi,Cafe.
>
> I want to create my own Programming Language with Haskell, and I learn
> how to do it.
> I read:
>
> WikiBooks of "Write Yourself a Scheme in 48 Hours",
> "Real World Haskell" of Chapter "Using Parsec",
> Source of "HJS",
> Book of "Introduction of Functional Programming Using Haskell".
>
> Ok,What is another good source creating my own Programming Language
> with Haskell?
> Thanks :)
>
> esehara
>
> ___
> 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