Re: [Haskell-cafe] Help me TH code.

2010-10-26 Thread Andy Stewart
Serguey Zefirov writes: > 2010/10/27 Andy Stewart : >> Hi all, >> >> I want use TH write some function like below: >> >>  data DataType = StringT >>                | IntT >>                | CharT >> >>  parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN) >> >> Example: >> >>  parse [("stri

Re: [Haskell-cafe] Help me TH code.

2010-10-26 Thread Serguey Zefirov
2010/10/27 Andy Stewart : > Hi all, > > I want use TH write some function like below: > >  data DataType = StringT >                | IntT >                | CharT > >  parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN) > > Example: > >  parse [("string", StringT), ("001", IntT), ("c", CharT

[Haskell-cafe] Re: Map constructor in a DSL

2010-10-26 Thread steffen
Ah, it's too early in the morning... There is still some room to simplify (e.g. fuse the liftE (map ...) ops). Here a simpler Version: evalObs (Map f obs) = liftE (map (evalObs.f.Konst)) (evalObs obs) >>= either (return.Left) (seq

[Haskell-cafe] Re: Map constructor in a DSL

2010-10-26 Thread steffen
Hi, I think you may want to over think your types again. Especially your Evaluator-Monad, and maybe your Map constructor. The Problem is, due to your use of Either and the need for evalObs to finally transform from "Obs [a]" type to "Evaluator [a]" you will end up in another Monad for Either:

[Haskell-cafe] Help me TH code.

2010-10-26 Thread Andy Stewart
Hi all, I want use TH write some function like below: data DataType = StringT | IntT | CharT parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN) Example: parse [("string", StringT), ("001", IntT), ("c", CharT)] will return: ("string", 001, 'c')

[Haskell-cafe] Pretty-printer for Text

2010-10-26 Thread Ivan Lazar Miljenovic
I'm currently working on a pretty-printer for lazy text [1] values, basing the API on the wl-pprint [2] package. [1]: http://hackage.haskell.org/package/text [2]: http://hackage.haskell.org/package/wl-pprint In terms of API decisions, there are a few things I'm not sure of and am wondering what o

Re: [Haskell-cafe] what is the status of haskell's mail libraries?

2010-10-26 Thread Michael Snoyman
I just release mime-mail[1], which can construct multipart messages. Michael [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mime-mail 2010/10/27 Günther Schmidt : > Hi all, > > I was just looking for mail libraries on hackage. You know libraries where I > can construct an email,

[Haskell-cafe] HDF5

2010-10-26 Thread Tim Sears
Does anybody know of any utilities in haskell for reading and writing HDF5 files? Other number crunchy formats? Thanks.--Tim ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Richard O'Keefe
On 27/10/2010, at 12:55 PM, Alexander Solla wrote: > > Difference equations show up in Knuth's "Concrete Mathematics", his tome on > discrete mathematics. The theory of difference equations is the discrete > analogue to the theory of differential equations. Surprisingly, the > continuous/di

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Alexander Solla
On Oct 26, 2010, at 4:21 PM, Richard O'Keefe wrote: Number theory would probably be out except maybe in a 2nd or 3rd year course leading to cryptography. Number theory is one of those weird cases. They are discrete structures, but advanced number theory uses a lot of complex analysis an

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Richard O'Keefe
On 27/10/2010, at 8:43 AM, Andrew Coppin wrote: > > Already I'm feeling slightly lost. (What does the arrow denote? What's are > "the usual logcal connectives"?) You mentioned Information Science, so there's a good chance you know something about Visual Basic, where they are called AND

Re: [Haskell-cafe] Map constructor in a DSL

2010-10-26 Thread Brandon Moore
You have to figure out here how you can use the function which is the argument to map. It seems you want to end up with a function of type a -> Evaluator b, to be used as an argument to mapM. One idea is to add a new constructor Var to represent variables, and something like evalVar :: Obs b -

[Haskell-cafe] what is the status of haskell's mail libraries?

2010-10-26 Thread Günther Schmidt
Hi all, I was just looking for mail libraries on hackage. You know libraries where I can construct an email, or retrieve on from the server. With retrieving an email I mean something with a bit more structure than a String, or, God help me, a ByteString. Where are we on this subject? I real

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Richard O'Keefe
On 27/10/2010, at 7:29 AM, Andrew Coppin wrote: > I didn't say "people think Haskell is scary because type theory looks crazy". > I said "people think Haskell is scary because the typical Haskeller thinks > that type theory looks *completely normal*". As in, Haskellers seem to think > that ever

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-26 Thread wren ng thornton
On 10/26/10 8:51 AM, Alexey Khudyakov wrote: On 24.10.2010 03:38, wren ng thornton wrote: I don't care much about the name of the class, I'd just like support for monoids, semirings,... when they lack a group, ring,... structure. Then what about following type class hierarchy? I think it suppo

Re: [Haskell-cafe] Test command line programs

2010-10-26 Thread Antoine Latter
On Tue, Oct 26, 2010 at 11:11 AM, Dupont Corentin wrote: > Hello again café, > > I have a command line program that takes input from various handles > (actually network sockets) like this: > >> s <- hGetLine h >> etc. > > I'd like to unit test this. How can I do? > I'd like to inject data on the h

Re: [Haskell-cafe] Map constructor in a DSL

2010-10-26 Thread Ryan Ingram
Instead of answering your question directly, I'll give you some code for a different DSL: data Exp ref a where EVar :: ref a -> Exp ref a ELam :: (ref a -> Exp ref b) -> Exp ref (a -> b) EAp :: Exp ref (a -> b) -> Exp ref a -> Exp ref b -- simple data structures EPair :: Exp

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Benedict Eastaugh
On 26 October 2010 20:43, Andrew Coppin wrote: > >> Propositional logic is quite a simple logic, where the building blocks >> are atomic formulae and the usual logical connectives. An example of a >> well-formed formula might be "P → Q". It tends to be the first system >> taught to undergraduates,

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Alexander Solla
On Oct 26, 2010, at 12:43 PM, Andrew Coppin wrote: Propositional logic is quite a simple logic, where the building blocks are atomic formulae and the usual logical connectives. An example of a well-formed formula might be "P → Q". It tends to be the first system taught to undergraduates,

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Andrew Coppin
On 26/10/2010 07:54 PM, Benedict Eastaugh wrote: On 26 October 2010 19:29, Andrew Coppin wrote: I don't even know the difference between a proposition and a predicate. A proposition is an abstraction from sentences, the idea being that e.g. "Snow is white", "Schnee ist weiß" and "La neige est

Re: [Haskell-cafe] problem with happy

2010-10-26 Thread Roman Dzvinkovsky
Great thanks! All work right now. 2010/10/26 Stephen Tetley > The lexer was wrong - but it was the lexer function not the lexer spec > - try the one below. > > Note that you have to take 'len' chars from the original input. > Previously you were taking the whole of the "rest-of--input": > > lexe

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Benedict Eastaugh
On 26 October 2010 19:29, Andrew Coppin wrote: > > I don't even know the difference between a proposition and a predicate. A proposition is an abstraction from sentences, the idea being that e.g. "Snow is white", "Schnee ist weiß" and "La neige est blanche" are all sentences expressing the same p

[Haskell-cafe] cross-platform compile

2010-10-26 Thread Hong Yang
Just curious if Haskell can or will generate cross-platform executable code, e.g., generate code for Linux from a Windows machine. Thanks, Hong ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-26 Thread Andrew Coppin
On 26/10/2010 11:33 AM, Joachim Breitner wrote: Hi, Until this is offered in an official position, this might be helpful if you ignore the Debian-related columns: http://people.debian.org/~nomeata/platform.html That's quite useful. It doesn't list the version numbers for GHC itself or for Hadd

Re: [Haskell-cafe] Test command line programs

2010-10-26 Thread Ben Millwood
On Tue, Oct 26, 2010 at 5:11 PM, Dupont Corentin wrote: > Hello again café, > > I have a command line program that takes input from various handles > (actually network sockets) like this: > >> s <- hGetLine h >> etc. > > I'd like to unit test this. How can I do? If all you ever do in some part of

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Andrew Coppin
On 25/10/2010 11:01 PM, Lauri Alanko wrote: On Mon, Oct 25, 2010 at 10:10:56PM +0100, Andrew Coppin wrote: Type theory doesn't actually interest me, I just wandered what the hell all the notation means. That sounds like an oxymoron. How could you possibly learn what the notation "means" without

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread Andrew Coppin
On 25/10/2010 10:36 PM, Gregory Collins wrote: Andrew Coppin writes: Hypothesis: The fact that the average Haskeller thinks that this kind of dense cryptic material is "pretty garden-variety" notation possibly explains why normal people think Haskell is scary. That's ridiculous. You're compari

[Haskell-cafe] [ANNOUNCE] csound-expression - csound combinator library

2010-10-26 Thread Anton Kholomiov
Hi, I'm glad to announce csound combinator library. It features liberation from id-style csound code, haskore-like composition structures, type-safe composable opcodes and simple instrument interface (no interface at all, instrument is just a function from some note representation to signal). ht

Re: [Haskell-cafe] Map constructor in a DSL

2010-10-26 Thread Dupont Corentin
Hey Chris! Values for PlayerNumber are acquired at evaluation time, from the state of the system. I have not included the evaluation of AllPlayers. Here how it looks: evalObs AllPlayers = return . pure =<< gets players But when you build your Obs, you have yet no idea how much players it will

[haskell-cafe] [ANNOUNCE] MissingPy 0.10.5

2010-10-26 Thread Matt Brown
Hello all, I've recently taken over maintenance of MissingPy, and pushed version 0.10.5 to hackage[1]. This includes two notable improvements: - fix build errors for python >= 2.5 - allow calling into multi-threaded python code (requires python >= 2.3). I'm trying to provide support for as man

Re: [Haskell-cafe] Map constructor in a DSL

2010-10-26 Thread Christopher Done
On 26 October 2010 18:07, Dupont Corentin wrote: > But how can I write the evaluator for Map? Where do values for PlayerNumber come from? Unless I'm mistaken, the only thing that Map can be used with is Obs [PlayerNumber], a list of values PlayerNumber which we have no means of acquiring in order

[Haskell-cafe] Fwd: Functional Programming in Industry Symposium: update correction

2010-10-26 Thread Jeroen Janssen
Dear all, The link provided below is incorrect. The correct link is https://spreadsheets.google.com/viewform?hl=en&formkey=dFVsNWZPWTdyT3NYOWRnT25GUzdJSFE6MQ#gid=0 Sorry for your inconvenience. Begin forwarded message: > From: Jeroen Janssen > Date: 26 oktober 2010 18:30:58 GMT+02:00 > To: gh

[Haskell-cafe] Functional Programming in Industry Symposiun: update

2010-10-26 Thread Jeroen Janssen
Dear all, For organizatorial reasons, we would like to ask that everyone interested in attending the symposium on functional programming in industry (see below) registers at https://spreadsheets.google.com/ccc?key=0Ak5F96CGaVoJdFVsNWZPWTdyT3NYOWRnT25GUzdJSFE&hl=en#gid=0 Kind Regards, The Ghent

Re: [Haskell-cafe] Test command line programs

2010-10-26 Thread Edward Z. Yang
Hello Dupont, If your code follows good style and has kept as much code out of IO as possible, you should be able to easily unit test the pure portions of your code. Otherwise, classic integration tests, by setting up the network jigs yourself, is standard. > Another little question: > How can I

[Haskell-cafe] Test command line programs

2010-10-26 Thread Dupont Corentin
Hello again café, I have a command line program that takes input from various handles (actually network sockets) like this: > s <- hGetLine h > etc. I'd like to unit test this. How can I do? I'd like to inject data on the handle so that all the input chain is tested. How are command line progra

[Haskell-cafe] Map constructor in a DSL

2010-10-26 Thread Dupont Corentin
Hello café, I have a little DSL in my program as follow. Now I'd like to add a Map constructor in it. Thats where I would need help! > data Obs a where > AllPlayers :: Obs [Int] > Plus :: (Num a) => Obs a -> Obs a -> Obs a > And:: Obs Bool -> Obs Bool -> Obs Bool >

Re: [Haskell-cafe] problem with happy

2010-10-26 Thread Stephen Tetley
The lexer was wrong - but it was the lexer function not the lexer spec - try the one below. Note that you have to take 'len' chars from the original input. Previously you were taking the whole of the "rest-of--input": lexer :: (TheToken -> P a) -> P a lexer f input@(_,_,instr) = case alexScan i

Re: [Haskell-cafe] problem with happy

2010-10-26 Thread Roman Dzvinkovsky
lexer works fine, problem is in happy parser. 2010/10/26 Stephen Tetley > Hello > > I would change you Alex specification to this: > > $digit = 0-9-- digits > $alpha = [a-zA-Z] -- alphabetic characters > $eol = [\r\n] > $any = [^$eol] > > tokens :- > > $eol

[Haskell-cafe] Haddock API and .haddock interface files questions

2010-10-26 Thread Claus Reinke
Some questions about Haddock usage: 1. Haddock executable and library are a single hackage package, but GHC seems to include only the former (haddock does not even appear as a hidden package anymore). Is that intended? 2. Naively, I'd expect Haddock processing to involve three stages: 1

Re: [Haskell-cafe] Working Generic/Polytypic Haskell extension

2010-10-26 Thread Sean Leather
Hi Mulhern, I would like to teach a small section on polytypism/genericity in the > "functional programming using Haskell" course I'm teaching. I won't, though, > unless I can assign an actual programming exercise in polytypic programming, > however brief. Can anybody recommend a functioning compi

[Haskell-cafe] Working Generic/Polytypic Haskell extension

2010-10-26 Thread mulhern
Hi all, I would like to teach a small section on polytypism/genericity in the "functional programming using Haskell" course I'm teaching. I won't, though, unless I can assign an actual programming exercise in polytypic programming, however brief. Can anybody recommend a functioning compiler that I

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-26 Thread Alexey Khudyakov
On 24.10.2010 03:38, wren ng thornton wrote: On 10/23/10 4:53 PM, Alexey Khudyakov wrote: On 23.10.2010 05:11, wren ng thornton wrote: I'd rather see, class Additive v where -- or AdditiveMonoid, if preferred zeroV :: v (^+^) :: v -> v -> v class Additive v => AdditiveGroup v where negateV ::

Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-26 Thread Jonas Almström Duregård
> Regardless, 7zip (LGPL) can do it. But you have to first inzip, and then untar as a seperate step. This is pretty far off topic, but you can actually unpack it in a single run. If you use the GUI version of 7z (a.k.a. the 7zip File Manager) you can open the .tar.gz and it will list a single .tar

Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-26 Thread Joachim Breitner
Hi, Am Sonntag, den 24.10.2010, 15:56 +0200 schrieb Simon Hengel: > > >It would be convenient to have a page which would list all the HP packages > > >with their versions. The release page [2] only has a list of packages > > >whose versions has changed since the last release, as I understood. > >

Re: [Haskell-cafe] In what language...?

2010-10-26 Thread David Virebayre
2010/10/25 Gregory Collins > Andrew Coppin writes: > > Hypothesis: The fact that the average Haskeller thinks that this kind of > > dense > > cryptic material is "pretty garden-variety" notation possibly explains why > > normal people think Haskell is scary. > That's ridiculous. That's not s

Re: [Haskell-cafe] problem with happy

2010-10-26 Thread Stephen Tetley
Hello I would change you Alex specification to this: $digit = 0-9-- digits $alpha = [a-zA-Z] -- alphabetic characters $eol = [\r\n] $any = [^$eol] tokens :- $eol { tok $ \_ -> Eol } $any+ { tok $ \s -> Str s } The complementatio