Re: [Haskell-cafe] PROPOSAL: Web application interface

2010-01-17 Thread Mark Lentczner
I like this project! Thanks for resurrecting it! Some thoughts: Methods in HTTP are extensible. The type RequestMethod should probably have a "catchall" constructor | Method B.ByteString Other systems (the WAI proposal on the Wiki, Hack, etc...) have broken the path into two parts: scr

Re: [Haskell-cafe] xmonad cannot find its library after upgrading GHC

2010-01-17 Thread Don Stewart
z_axis: > > After `pacman -Syu`, the ghc is upgraded to 6.12.1 > %ghc --version > The Glorious Glasgow Haskell Compilation System, version 6.12.1 > > However, the xmonad still stay as it is: > %pacman -Q|grep -i xmonad > xmonad 0.9-2.1 > xmonad-contrib 0.9-1.2 > > %pacman -Ql xmonad|more >

[Haskell-cafe] xmonad cannot find its library after upgrading GHC

2010-01-17 Thread zaxis
After `pacman -Syu`, the ghc is upgraded to 6.12.1 %ghc --version The Glorious Glasgow Haskell Compilation System, version 6.12.1 However, the xmonad still stay as it is: %pacman -Q|grep -i xmonad xmonad 0.9-2.1 xmonad-contrib 0.9-1.2 %pacman -Ql xmonad|more .. xmonad /usr/lib/ghc-6.10.4/ x

[Haskell-cafe] parallel matrix multiply (dph, par/pseq)

2010-01-17 Thread Johannes Waldmann
Hello. How can I multiply matrices (of Doubles) with dph (-0.4.0)? (ghc-6.12.1) - I was trying type Vector = [:Double:] type Matrix = [:Vector:] times :: Matrix -> Matrix -> Matrix times a b = mapP ( \ row -> mapP ( \ col -> sumP ( zipWithP (*) row col ) ) (

Re: [Haskell-cafe] Re: Arrow instance of Transducer (Was: [Haskell] ANN: Streaming Component Combinators 0.4)

2010-01-17 Thread Mario Blažević
On Sun 17/01/10 4:47 PM , Twan van Laarhoven twa...@gmail.com sent: > The Arrow class is too big, it includes too many things and it should be > split up. This is yet another example. You can get some of the benefits of > standard classes by making Transducer an instance of > Control.Category.Cat

Re: [Haskell-cafe] ANN: atom-0.1.3

2010-01-17 Thread Tom Hawkins
On Sun, Jan 17, 2010 at 1:16 PM, miaubiz wrote: > > I am trying to generate a square wave.  Here's the code: > >    square <- bool "square" False > >    period 2 $ atom "square high" $ phase 0 $ do >        square <== true >        assert "square is low" $ not_ $ value square > >    period 2 $ ato

Re: [Haskell-cafe] Re: Arrow instance of Transducer (Was: [Haskell] ANN: Streaming Component Combinators 0.4)

2010-01-17 Thread Twan van Laarhoven
Mario Blažević wrote: After some investigation, I've concluded that Transducer cannot be made an instance of Arrow in any way that's both practical and general. the arr and (>>>) methods are trivial: but there is no satisfactory definition for the method first. The Arrow class is too big,

Re: [Haskell-cafe] Type Inference for Overloading without Restrictions

2010-01-17 Thread Carlos Camarao
On Wed, Jan 13, 2010 at 7:57 AM, Peter Verswyvelen wrote: > A while ago, someone provided me a link to the paper "Type Inference > for Overloading without Restrictions" > http://www.dcc.ufmg.br/~camarao/ct-flops99.ps.gz > > Although I don't under

Re: [Haskell-cafe] Why no merge and listDiff?

2010-01-17 Thread Derek Elkins
On Sun, Jan 17, 2010 at 2:22 PM, Will Ness wrote: > Hello cafe, > > I wonder, if we have List.insert and List.union, why no List.merge (:: Ord a > => > [a] -> [a] -> [a]) and no List.minus ? These seem to be pretty general > operations. Presumably by List.minus you mean the (\\) function in Data

Re: [Haskell-cafe] Why no merge and listDiff?

2010-01-17 Thread Miguel Mitrofanov
On 17 Jan 2010, at 23:22, Will Ness wrote: What are such types called? Dependent ones. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Why no merge and listDiff?

2010-01-17 Thread Will Ness
Hello cafe, I wonder, if we have List.insert and List.union, why no List.merge (:: Ord a => [a] -> [a] -> [a]) and no List.minus ? These seem to be pretty general operations. Brief look into haskell-prime-report/list.html reveals nothing. Could we please have them? On the wider perspective, i

[Haskell-cafe] Takusen - reading from one db inserting into another

2010-01-17 Thread Günther Schmidt
Hi, I know how to use Takusen with a *single* connection, but I cannot figure out how to read from one database while inserting to another. Could someone please explain to me how I can do that? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@h

Re: [Haskell-cafe] Parsers for Text Adventures

2010-01-17 Thread Tim Wawrzynczak
Hi Mark, I recently ported Conrad Barski's 'Casting SPELs in Lisp' to Haskell (a text adventure game). I had some of these problems as well, and you can find my code on Hackage (the package is called Advgame). Some things in there might be of some help. Cheers, - Tim On Sun, Jan 17, 2010 at 7

Re: [Haskell-cafe] Parsers for Text Adventures

2010-01-17 Thread Iavor Diatchki
Hi Mark, On Sun, Jan 17, 2010 at 5:30 AM, Mark Spezzano wrote: > Question: Am I going about this the right way? I want to put together lots of > "data" types like Verb and Noun etc so that I can build a kind of "BNF > grammar". Your basic idea to use a datatype is a good one. You just need to

[Haskell-cafe] ANN: afv-0.0.2

2010-01-17 Thread Tom Hawkins
AFV is an infinite state model checker for simple, iterative C programs. This release adds some new name checks, a few minor bug fixes, basic support for functions, and a little stronger type checking. Though most of the C language is still not supported, it can verify a lot of interesting behavi

[Haskell-cafe] Re: Arrow instance of Transducer (Was: [Haskell] ANN: Streaming Component Combinators 0.4)

2010-01-17 Thread Mario Blažević
>>> Stupid question: Is it related to Arrows? >> >> Not really. You might say it's more general than arrows, because >> the streaming components are not restricted to a single input and >> single output type. On the other hand, they are all specific to stream >> processing, much like Fudgets

[Haskell-cafe] PROPOSAL: Web application interface

2010-01-17 Thread Michael Snoyman
Following up on the previous thread, I've started a github project for some ideas of a web application interface. It's borrowing from both Hyena and Hack, with a few of its own ideas. The project is available at http://github.com/snoyberg/wai, and the Network.Wai module is available at http://githu

Re: [Haskell-cafe] cabal install vacuum-cairo

2010-01-17 Thread Gwern Branwen
On Sun, Jan 17, 2010 at 9:55 AM, Ozgur Akgun wrote: > Cafe, > > I've been trying to install vacuum-cairo using cabal but I couldn't have it > installed because of the missing packages cairo, svg and gtkcairo. > > What should I do to install vacuum-cairo? > > Thanks for any help in advance, Those

[Haskell-cafe] cabal install vacuum-cairo

2010-01-17 Thread Ozgur Akgun
Cafe, I've been trying to install vacuum-cairo using cabal but I couldn't have it installed because of the missing packages cairo, svg and gtkcairo. What should I do to install vacuum-cairo? Thanks for any help in advance, -- Ozgur Akgun ___ Haskell

Re[2]: [Haskell-cafe] Re: Parse error

2010-01-17 Thread Bulat Ziganshin
Hello VoidPrayer, Sunday, January 17, 2010, 5:32:55 PM, you wrote: > By the way, is it only valid when "let" only affects the one expression after > that? I read "where vs let" in the HaskellWiki but all the examples are "let > ... in". the "let" inside "do" is just a syntax sugar: do xxx le

Re: [Haskell-cafe] Dependency trickery

2010-01-17 Thread Felipe Lessa
On Sun, Jan 17, 2010 at 02:25:39PM +, Malcolm Wallace wrote: > Not true. The value of the flag *is* determined automatically based > on what packages you already have on your system. Oh, then please forgive my mistake. Cabal is smarter than I am :). Thanks, Malcolm! -- Felipe.

Re: [Haskell-cafe] Re: Parse error

2010-01-17 Thread VoidPrayer
Oh, I should know that. Thank you. By the way, is it only valid when "let" only affects the one expression after that? I read "where vs let" in the HaskellWiki but all the examples are "let ... in". 在 2010年 1月 17日 星期日 22:13:14,Maciej Piechotka 寫道: > On Sun, 2010-01-17 at 18:10 +0800, VoidPrayer

Re: [Haskell-cafe] Dependency trickery

2010-01-17 Thread Malcolm Wallace
Suppose I write some code that can work with Gtk2hs or wxHaskell. How do I go about making that into a package? You just need to add a flag 'gtk2hs' and then construct the Build-Depends depending on the value of the flag. However, if e.g. that flag is by default True, then users of wxHaskell wi

Re: [Haskell-cafe] Parsers for Text Adventures

2010-01-17 Thread Luke Palmer
On Sun, Jan 17, 2010 at 7:02 AM, Stephen Tetley wrote: > I wouldn't use read instead something either a simple function: > > > verb :: String -> Maybe Verb > > verb "Go" = Just Go > > verb "Get" = Just Get > > verb _ = Nothing > > Or possible a Map: > > > verb2 :: String -> Maybe Verb > > v

[Haskell-cafe] Re: Parse error

2010-01-17 Thread Maciej Piechotka
On Sun, 2010-01-17 at 18:10 +0800, VoidPrayer wrote: > let ... > in ... > > I guess GHC is finding where "in" is. Except that: main = do l <- getLine let l' = lines l print l' Is perfectly valid without in. Similary: something = proc (x, y) -> do x' <- someArrow -< x

Re: [Haskell-cafe] Parsers for Text Adventures

2010-01-17 Thread Daniel Fischer
Am Sonntag 17 Januar 2010 14:30:36 schrieb Mark Spezzano: > Hi, > > I am writing a Text Adventure game in Haskell (like Zork) > > I have all of the basic parser stuff written as described in Hutton's > Programming in Haskell and his associated papers. (I'm trying to avoid > using 3rd party librarie

Re: [Haskell-cafe] Parsers for Text Adventures

2010-01-17 Thread Stephen Tetley
Hello Mark [ Literate haskell follows... ] > module Verb where > import qualified Data.Map as Map > import Data.Char > data Verb = Go | Get | Jump | Climb | Give deriving (Show, Read) I wouldn't use read instead something either a simple function: > verb :: String -> Maybe Verb > verb "Go"

Re: [Haskell-cafe] Parsers for Text Adventures

2010-01-17 Thread Luke Palmer
On Sun, Jan 17, 2010 at 6:30 AM, Mark Spezzano wrote: > I've written a Parser called keyword > > keyword :: Parser Verb > keyword = do x <- many1 letter >return (read x) > > (read this as > "take-at-least-one-alphabetic-letter-and-convert-to-a-Verb-type") > > which DOES wo

Re: [Haskell-cafe] Re: AlternativePrelude extension

2010-01-17 Thread Taru Karttunen
Excerpts from Roel van Dijk's message of Sun Jan 17 13:50:22 +0200 2010: > The "extensions" field in a cabal package description is a bit tricky. > The documentation states "A list of Haskell extensions used by every > module". This might give the impression that it documents the various > extensio

Re: [Haskell-cafe] Dependency trickery

2010-01-17 Thread Felipe Lessa
On Sun, Jan 17, 2010 at 10:09:14AM +, Andrew Coppin wrote: > Suppose I write some code that can work with Gtk2hs or wxHaskell. > How do I go about making that into a package? > > Specifically, how do I make it so that you don't have to install > Gtk2hs *and* wxHaskell to build it? Do I have to

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Hans Aberg
On 17 Jan 2010, at 11:44, Andrew Coppin wrote: Urg, but that's *ugly*. Is there no way I can reduce the amount of indentation to something more reasonable? main = do putStrLn "Line 1" putStrLn "Line 2" let xs = do x <- [1..10] y <- [1..10] return (x+y) print xs That

[Haskell-cafe] Parsers for Text Adventures

2010-01-17 Thread Mark Spezzano
Hi, I am writing a Text Adventure game in Haskell (like Zork) I have all of the basic parser stuff written as described in Hutton's Programming in Haskell and his associated papers. (I'm trying to avoid using 3rd party libraries, so that I can learn this myself) Everything that I have works (s

Re: [Haskell-cafe] ANN: amqp-0.1

2010-01-17 Thread Ross Paterson
On Sun, Jan 17, 2010 at 12:35:08PM +0100, Holger Reinhardt wrote: > Get it here: http://hackage.haskell.org/package/amqp > > For some reason it doesn't compile on Hackage. It says "At least the following > dependencies are missing: network-bytestring >=0.1.2". Is there a way to solve > this? Sorr

Re: [Haskell-cafe] ANN: atom-0.1.3

2010-01-17 Thread miaubiz
Tom Hawkins-2 wrote: > > period 20 $ atom "checkSomeStuff" $ do > cond ok > assert "A" a > assert "B" b > cover "C" c > I am trying to generate a square wave. Here's the code: square <- bool "square" False period 2 $ atom "square high" $ phase 0 $ do square <== tru

Re: [Haskell-cafe] Re: AlternativePrelude extension

2010-01-17 Thread Roel van Dijk
On Sun, Jan 17, 2010 at 12:27 PM, Ketil Malde wrote: > I think there might be justification for doing it multiple places.  The > cabal file tells you what is required to build the package, the pragmas > what is required to build each source file. > > Perhaps cabal should complain when source files

Re: [Haskell-cafe] Language simplicity

2010-01-17 Thread Andrew Coppin
Eduard Sergeev wrote: OK, my version of meaningless statistics: C++ (ISO/IEC 14882:1998(E)): 325 pages (712 including standard libraries) C# (ECMA-334): 505 pages (language only) Java: 450 pages (language only?) Scala (2.7): 125 pages (157 including standard library) Eiffel (ECMA-367): 160 pages

[Haskell-cafe] Presentation about ICFP'09 programming contest

2010-01-17 Thread Janis Voigtländer
Hi Haskell folk, If you are in Madrid tomorrow (Monday), you will likely not want to miss the video presentation by Andy Gill and his group about the techniques behind their running the ICFP'09 programming contest: http://www.program-transformation.org/PEPM10/SpecialFeature The presentation is

[Haskell-cafe] ANN: amqp-0.1

2010-01-17 Thread Holger Reinhardt
Hi, I've built an AMQP library. It currently only works with RabbitMQ and supports most of the 0-8 spec. If you don't know that AMQP is, this is a good introduction: http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/ I have not done much testing, so this should be regarded as alpha quality

Re: [Haskell-cafe] Re: AlternativePrelude extension

2010-01-17 Thread Ketil Malde
Maciej Piechotka writes: >> However, the option to set language extension globally is still >> available, either as an option to the compiler when building, or in >> the cabal file describing the package. > Hmm. Since the extensions should be specified in Cabal anyway (at least > I guess it does

Re: [Haskell-cafe] Language simplicity

2010-01-17 Thread jur
Andrew Coppin wrote: OK people, it's random statistics time! OK, my version of meaningless statistics: Java: 450 pages (language only?) Which version is this? The version of the Java Language Specification (version 3.0, 2005) I am currently reading has 684 pages. I'd prefer to read o

[Haskell-cafe] Haskell Weekly News: Issue 146 - January 17, 2010

2010-01-17 Thread jfredett
--- Haskell Weekly News http://sequence.complete.org/hwn/20100117 Issue 146 - January 17, 2010 --- Welcome to issue 146 of HWN, a newsletter covering

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Andrew Coppin
Daniel Fischer wrote: Am Sonntag 17 Januar 2010 11:33:45 schrieb Andrew Coppin: Urg, but that's *ugly*. Is there no way I can reduce the amount of indentation to something more reasonable? main = do putStrLn "Line 1" putStrLn "Line 2" let xs = do x <- [1..10] y

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Ross Paterson
On Sun, Jan 17, 2010 at 10:33:45AM +, Andrew Coppin wrote: > Tony Morris wrote: > >main = do > > putStrLn "Line 1" > > putStrLn "Line 2" > > > > let xs = do x <- [1..10] > > y <- [1..10] > > return (x+y) > > > > print xs > > Urg, but that's *ugly*. Is there no way I can

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Daniel Fischer
Am Sonntag 17 Januar 2010 11:33:45 schrieb Andrew Coppin: > Tony Morris wrote: > > No, but there's a specific reason why GHC consistently refuses to > > accept your perfectly unreasonable code snippet :) > > She sells csh on the sea shore. :-) > > > GHC accepts the following perfectly reasonable co

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Andrew Coppin
Tony Morris wrote: No, but there's a specific reason why GHC consistently refuses to accept your perfectly unreasonable code snippet :) She sells csh on the sea shore. :-) GHC accepts the following perfectly reasonable code snippet: main = do putStrLn "Line 1" putStrLn "Line 2" let xs

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Daniel Fischer
Am Sonntag 17 Januar 2010 11:05:47 schrieb Andrew Coppin: > Is there a specific reason why GHC consistently refuses to accept the > following perfectly reasonable code snippet? Yes, you violated the layout rule. > > main = do > putStrLn "Line 1" > putStrLn "Line 2" > > let xs = do > x <

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Tony Morris
No, but there's a specific reason why GHC consistently refuses to accept your perfectly unreasonable code snippet :) GHC accepts the following perfectly reasonable code snippet: main = do putStrLn "Line 1" putStrLn "Line 2" let xs = do x <- [1..10] y <- [1..10] retur

Re: [Haskell-cafe] Parse error

2010-01-17 Thread VoidPrayer
let ... in ... I guess GHC is finding where "in" is. 在 2010年 1月 17日 星期日 18:05:47,Andrew Coppin 寫道: > Is there a specific reason why GHC consistently refuses to accept the > following perfectly reasonable code snippet? > > main = do > putStrLn "Line 1" > putStrLn "Line 2" > > let xs = do >

[Haskell-cafe] Dependency trickery

2010-01-17 Thread Andrew Coppin
Suppose I write some code that can work with Gtk2hs or wxHaskell. How do I go about making that into a package? Specifically, how do I make it so that you don't have to install Gtk2hs *and* wxHaskell to build it? Do I have to actually make it into two seperate packages to do that? Also, supp

[Haskell-cafe] Parse error

2010-01-17 Thread Andrew Coppin
Is there a specific reason why GHC consistently refuses to accept the following perfectly reasonable code snippet? main = do putStrLn "Line 1" putStrLn "Line 2" let xs = do x <- [1..10] y <- [1..10] return (x+y) print xs No matter which way I rearrange this, it *insists* that the