Patrick LeBoutillier | 1 Jun 13:57 2010
Picon

Re: Why Either = Left | Right instead of something like Result = Success | Failure

On Thu, May 27, 2010 at 3:17 PM, Mike Dillon <mike <at> embody.org> wrote:
> begin C. McCann quotation:
>> Personally, I advocate instead using "Sinister" and "Dexter". Nice and
>> catchy, don't you think?
>
> Has anyone done a "translation" of the Prelude into Latin?
>
>> modulus PraeLudus ubi
>>
>> data Uter a b = Sinister a
>>               | Dexter b
>>               derivare (Aequo, Ordinaro, Lego, Monstro)
>
> Ha.

Not Haskell, but check this one out:

http://search.cpan.org/~dconway/Lingua-Romana-Perligata-0.50/lib/Lingua/Romana/Perligata.pm

Patrick

>
> -md
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

--

-- 
(Continue reading)

Louis Wasserman | 1 Jun 02:47 2010
Picon

Language Shootout reverse-complement benchmark

Hey,


I was looking at the reverse-complement benchmark on the Language Shootout, and among other things, I noticed that the Haskell implementation was using (filter (/= '\n')) on ByteStrings, and also using lists as queues.  

I had a few improvements which using -fasm seem to yield about a 19% improvement in speed, and a 35% reduction in allocation, on my computer.  (If both programs are compiled with -fllvm -- I'm not sure whether or not that's fair game on the Shootout -- my implementation is 35% faster, and does 10% less allocation.)  I've checked my code on the Shootout's test input, as well.

Mostly, the improvement comes from a tightly specialized version of (filter (/= '\n')), although eliminating an intermediate list entirely (and one used in a queuelike fashion) didn't seem to hurt.  I managed to cut the program to a point where the program size is about the same as before.


Let the arguing begin?
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Лев Никитин | 1 Jun 13:07 2010
Picon

Re: Haskell + CouchDB, anyone?

I hav not run your examples. But

1. May be you have put to couchdb only *object* (braked by {}) but not array?
2. Why not to define data (data Mydata = Mydata {...}) and
   declare it as instance of JSON
   you can find example of using couchDB via google.com/codesearch
(lang:haskell couchDB)

--

-- 
Никитин Лев.
nlv <at> lab321.ru, Leon.V.Nikitin <at> gmail.com
C K Kashyap | 1 Jun 13:06 2010
Picon

Parselib sample

Hi,
Is there a not-so-trivial parser implementation with Parselib? Parser for a "C" like language would be good.
I searched and found Haskell++ -> http://www.cs.chalmers.se/~rjmh/Software/h++.html
However, I'd prefer to look at a parser for a "C" like language.

--
Regards,
Kashyap

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Don Stewart | 1 Jun 01:13 2010

The state of Hackage: what are we doing about it?

I see fairly regular complaints about too many Haskell libraries,
bewildering choice of difficult-to-determine quality.

I've tried to summarize the state of Hackage, and what projects are
active to make it easier to find high quality libraries:

    http://tinyurl.com/2cqw9sb

Thoughts?

-- Don
David Leimbach | 1 Jun 16:25 2010
Picon

Re: Language Shootout reverse-complement benchmark

I'm still trying to figure out what the point of the shootout really is.  If there's no dedicated folks working with a language there, trying to make things run faster, a language will come out looking inefficient potentially.  There's a lot of compile flags and optimizations that can make a difference in probably all of the languages listed on that page.


I guess all you can get from the shootout is a sense of what a particular language or set of tools is capable of in the hands of the programmers who submit implementations.  It doesn't really give you a concrete idea as to how to evaluate a programming language.

It does still seem kind of fun for some reason though :-)

Dave

On Mon, May 31, 2010 at 5:47 PM, Louis Wasserman <wasserman.louis <at> gmail.com> wrote:
Hey,

I was looking at the reverse-complement benchmark on the Language Shootout, and among other things, I noticed that the Haskell implementation was using (filter (/= '\n')) on ByteStrings, and also using lists as queues.  

I had a few improvements which using -fasm seem to yield about a 19% improvement in speed, and a 35% reduction in allocation, on my computer.  (If both programs are compiled with -fllvm -- I'm not sure whether or not that's fair game on the Shootout -- my implementation is 35% faster, and does 10% less allocation.)  I've checked my code on the Shootout's test input, as well.

Mostly, the improvement comes from a tightly specialized version of (filter (/= '\n')), although eliminating an intermediate list entirely (and one used in a queuelike fashion) didn't seem to hurt.  I managed to cut the program to a point where the program size is about the same as before.


Let the arguing begin?

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Mike Dillon | 1 Jun 05:20 2010

Re: name of this monadic combinator?

begin Brent Yorgey quotation:
> On Sun, May 30, 2010 at 11:15:40AM -0700, Mike Dillon wrote:
> > begin Michael Snoyman quotation:
> > > http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/Control-Monad.html#v%3AliftM2
> > > 
> > > <file:///usr/share/doc/ghc6-doc/html/libraries/base-4.2.0.0/Control-Monad.html#v%3AliftM2>Strangely,
> > > Hayoo didn't turn this one up... anyone know why?
> > 
> > Hoogle finds it. I didn't think Hayoo was expected to do this sort of
> > abstract type signature search:
> > 
> >     http://haskell.org/hoogle/?hoogle=Monad+m+%3D%3E+%28a+-%3E+a+-%3E+a%29+-%3E+m+a+-%3E+m+a+-%3E+m+a
> > 
> > It comes up as the second hit on that search or the first hit on this
> > one:
> > 
> >     http://haskell.org/hoogle/?hoogle=Monad+m+%3D%3E+%28a+-%3E+b+-%3E+c%29+-%3E+m+a+-%3E+m+b+-%3E+m+c
> > 
> > That second search also shows zipWith in there; I never really thought
> > about zipWith being like liftM2 for the list Monad. I don't believe
> > that's actually true for the normal list Monad, but it should be true of
> > an alternate list Monad along the lines of the Functor and Applicative
> > instances for the ZipList newtype in Control.Applicative.
> 
> As Max noted, ZipList is not a monad.  However, you have the right
> idea: zipWith is exactly liftA2 (the equivalent of liftM2 for
> Applicatives) for ZipList.

Thanks to both you and Max. After you guys responded, I went back and
found an interesting haskell-cafe discussion about how ZipList cannot be
made into a Monad from August 2009.

I should have realized that there was a reason there is no Monad
instance defined along with ZipList.

-md
Stephen Tetley | 1 Jun 16:29 2010
Picon

Re: Parselib sample

Hello

For non-trivial parsing Parsec or UU-Parse are much better candidates.

If you have Parsec installed from Hackage, I'd still recommend you get
the manual and source distribution from:

http://legacy.cs.uu.nl/daan/parsec.html

The source distribution has some examples - Tiger, Mondrian, Henk -
full, if small languages.
C is quite a large language and its grammar is usually presented for
LR parsing so you are unlikely to find a parser for C or even a subset
of C with a combinator library, as parser combinators are LL. To
convert LR to LL needs a lot of left factoring and wouldn't be fun,
though I believe there is a C parser for the ANTLR system which is
LL(k).

Best wishes

Stephen
Gery Debongnie | 1 Jun 16:30 2010
Picon

design question/font metrics

Dear Haskell-Cafe list,

Since I am learning Haskell, I decided to try to do a real program, to
practice and give me some experience.  I choose to do a basic
typesetting program (like TeX/LaTeX).  Now, obviously, such a program
needs to manipulate font objects, and in particular, font metrics.
Basically, I would like some function like this :

stringWidth :: Font -> String -> Double
charWidth :: Font -> Char -> Double

which take some appropriate font type, string or char, and gives me a
width (also height) in some given unit.  I'd like it to take into
account appropriate kerning.

Question 1 :
Now, I may be missing something, but a quick search on Google/Hackage
didn't yield anything. Is there an existing package, or any nice and
simple way to deal with that problem?

Question 2 :
In case the answer to the previous question is negative, I guess I
will need to do it myself, the old-fashioned way.  Now, this is where
I have a design question.  The thing is that font metrics information
are encoded into some file (either .tfm or .pl files, for TeX fonts),
so my function stringWidth will need to read a file, which is, gasp,
an IO operation. Therefore, its type will be something like

stringWidth :: Font -> String -> IO Double

and it will "infect" pretty much everything else.  It doesn't sound
really appealing, so I'd like your opinions on this subject.  To start
the conversation, here are the solutions that I have in mind, so far :

1. well, do nothing, and let IO infect everything.

2. use unsafePerformIO  to get rid of IO.  (I am weary to do this,
since I am a newbie, and I don't really want to start using that
function everywhere...  However, in this case, it looks kinda
legitimate...)

3. Perform a reading of the font metrics file in the main program, put
the results into some FontMetrics object, and give that to stringWidth
:: FontMetrics -> Font -> String -> Double.  Pros : allow me to avoid
problems of solution 1 and 2, cons : it doesn't sound right for the
main program to have to do this, it should be confined into a Font
module.

Any other ideas, suggestions?

Gery D.
Marc Weber | 1 Jun 16:34 2010
Picon
Picon

Re: The state of Hackage: what are we doing about it?

Excerpts from Don Stewart's message of Tue Jun 01 01:13:20 +0200 2010:
> I see fairly regular complaints about too many Haskell libraries,
> bewildering choice of difficult-to-determine quality.

I want to send a small reminder that there was the idea adding a public
wiki for each project which can react upon wishes of users faster than
everything else:
http://haskell.org/haskellwiki/Hackage_wiki_page_per_project_discussion

Marc Weber

Gmane