Re: [Haskell-cafe] Number formatting

2010-02-08 Thread Stephen Tetley
Hi Günther Ahem... *FormatDecimal formatDecimal (888.005) ,888.01 I'll post a revision shortly (that handles negatives as well) ... On 8 February 2010 13:09, Stephen Tetley stephen.tet...@gmail.com wrote: Hello All Alternatively, less dependencies and a bit less golf (but not much testing

Re: [Haskell-cafe] Number formatting

2010-02-08 Thread Stephen Tetley
,def,ghi a,bcd,efg,hij ab,cde,fgh,ijk abc,def,ghi,jkl a,bcd,efg,hij,klm ab,cde,fgh,ijk,lmn abc,def,ghi,jkl,mno On 8 February 2010 13:40, Stephen Tetley stephen.tet...@gmail.com wrote: Ahem... *FormatDecimal formatDecimal (888.005) ,888.01 I'll post a revision shortly (that handles negatives

Re: [Haskell-cafe] a beginner question: decorate-op-undecorate

2010-02-08 Thread Stephen Tetley
On 8 February 2010 11:16, John Lato jwl...@gmail.com wrote: Regardless, I think this is a valid approach.  By thinking of data in terms of Functor, Traversable, etc., one can recognize these patterns.  Even if Binding is part of a larger syntax tree and can't reasonably be made polymorphic,

Re: [Haskell-cafe] a beginner question: decorate-op-undecorate

2010-02-06 Thread Stephen Tetley
Hello Aran Changing to an explicit sum type rather than using Either might subsequent functions that process a Binding cleaner: data Binding = BoundVar Var Value | PossiblyBound Var [Value] Naturally you might want to consider a better constructor name than 'PossiblyBound'.

Re: [Haskell-cafe] a beginner question: decorate-op-undecorate

2010-02-06 Thread Stephen Tetley
Hi John I'm not sure about making Binding polymorphic to get Functor, Traversable, Foldable... While I think you're correct that partitionEithers might not be a useful example to draw from in this case, I'd assume that Binding would be part of a larger syntax-tree, thus there might not be a

Re: [Haskell-cafe] Multi-Class monadic type?

2010-02-03 Thread Stephen Tetley
On 3 February 2010 13:10, Alexander Treptow alexander.trep...@googlemail.com wrote: I need a data type that creates a record with a member that has no fixed type, because its not known at compile-time. A type unknown at compile-type pretty much defines a dynamic type, so how about

Re: [Haskell-cafe]SYB/Generics documentation inaccessible

2010-02-02 Thread Stephen Tetley
Hello The most of the papers the Wikipedia page links to should be publicly accessible, I've just checked the ones hosted at Utrecht University (e.g the Generic Haskell manual and Andres L\ohs thesis). Ralf Hinze has changed universities, so the link to

Re: [Haskell-cafe]SYB/Generics documentation inaccessible

2010-02-02 Thread Stephen Tetley
Apologies for the rather garbled last message (I was trying to type whilst checking a multitude of links in a plethora or browser windows)... The SYB papers are here http://research.microsoft.com/en-us/um/people/simonpj/Papers/hmap/ The code seems to have vanished at the moment, maybe someone

Re: [Haskell-cafe] OT: Literature on translation of lambda calculus to combinators

2010-01-28 Thread Stephen Tetley
Hi Dušan The Ester shell written in Clean compiles via the SKI combinators. It is describe in the paper - 'A Functional Shell that Operates on Typed and Compiled Applications' by Arjen van Weelden and Rinus Plasmeijer which is available here:

Re: [Haskell-cafe] Re: classes with types which are wrapped in

2010-01-27 Thread Stephen Tetley
2010/1/27 Andrew U. Frank fr...@geoinfo.tuwien.ac.at: {Snip] dotoBfield :: (b - b) - X a b c - X a b c dotoBfield  op x = x { bfield = op (bfield x)} and similar for A and C. is there a better idiom to achieve the same effect? can this be automated (for example, using generics)? Hello

Re: [Haskell-cafe] Naive booleans and numbers - type-checking fails

2010-01-24 Thread Stephen Tetley
Doesn't the simply typed lambda calculus introduce if-then-else as a primitive precisely so that it can be typed? Its not an illuminating answer to your question and I'd welcome clarification for my own understanding, but I don't think you can solve the problem without appealing to Haskell's

Re: [Haskell-cafe] Windows emulator for testing purposes

2010-01-18 Thread Stephen Tetley
Hello Gregory If the packages are FFI-free they should just work (ahem, perhaps with some caveats about e.g. file paths - if they have data files included). If they have FFI dependencies then a Windows emulator is going to have to emulate Unix in turn (either via MinGW or Cygwin). It might be

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 = Just

Re: [Haskell-cafe] From records to a type class

2010-01-16 Thread Stephen Tetley
Hi Taru If you haven't obviously got dispatch on type then records are certainly fine. Some obigatory examples: http://www.cas.mcmaster.ca/~kahl/Publications/TR/2000-01/Kahl-Braun-Scheffczyk-2000a.pdf (see the Editor type page 13)

Re: [Haskell-cafe] Re: Design question, HTML for GUIs?

2010-01-15 Thread Stephen Tetley
2010/1/15 Günther Schmidt gue.schm...@web.de: Thank you guys for all your responses. I just came accross something called HTML-Dialogs. It's mentioned in the ANNOUNCE files of the 0.26 source package of HaskellDirect. Apparently it takes about (on Windows) using HTML to create GUIs and

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Stephen Tetley
Hello Does you find this version easier to understand? rangeProduct :: Int - Int - Int rangeProduct m n = if m n then 0 else if m == n then m else m * rangeProduct (m+1) n I would suspect the main point of the example is

Re: [Haskell-cafe] Haskell implementation of ideas from StandardML as a Metaprogramming language

2010-01-14 Thread Stephen Tetley
Hello Kashyap I can do MSL and Region, maybe I did the parser combinators but I can't find them at the moment. I tried to keep the code close to the original SML, so as Haskell code its not pretty. Not having quasiquote was a problem. Best wishes Stephen

Re: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-14 Thread Stephen Tetley
Hello Daniel On Windows, isn't stdcall vs ccall still dependent on the actual library and what compiled it - commonly MSVC (stdcall) or gcc (ccall) of course? I could very easily be wrong... Best wishes Stephen 2010/1/14 Daniel Fischer daniel.is.fisc...@web.de: Am Donnerstag 14 Januar

Re: Re[2]: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-14 Thread Stephen Tetley
2010/1/14 Bulat Ziganshin bulat.zigans...@gmail.com: there is better way rather than playing with random bits. just find tutorial on FFI, and try it. once this example works, start modifying it to learn various aspects of ffi and add functionality you need Also binding to a C library is

Re: [Haskell-cafe] Tokenizing and Parsec

2010-01-12 Thread Stephen Tetley
2010/1/12 Günther Schmidt gue.schm...@web.de: [Snip...] I need to write my own parsec-token-parsers to parse this token stream in a context-sensitive way. Uhm, how do I that then? Hi Günther Get the Parsec manual from Daan Leijen's home page then see the section '2.11 Advanced: Seperate

Re: [Haskell-cafe] Parsers (Parsec and Iteratee-based Parsers)

2010-01-12 Thread Stephen Tetley
2010/1/12 Pasqualino Titto Assini tittoass...@gmail.com: The frisby parser (http://repetae.net/computer/frisby/) that unfortunately is not well known as it has never been uploaded on hackage also supports lazy parsing. Doaitse Swierstra's new version of UU supports online parsing too:

Re: [Haskell-cafe] Why doesn't laziness save the day here?

2010-01-05 Thread Stephen Tetley
2010/1/5 Dale Jordan da...@alum.mit.edu: The motivation for iterateR is to be able to have the ultimate consumer determine how many random values to force, but still have a single random generator used throughout the computation. Hi Dale If you want the producer and consumer to run at

Re: [Haskell-cafe] (liftM join .) . mapM

2009-12-29 Thread Stephen Tetley
2009/12/29 Tony Morris tonymor...@gmail.com: Can (liftM join .) . mapM be improved? (Monad m) = (a - m [b]) - [a] - m [b] Hi Tony I count this as a personal preference rather than an improvement: joinything2 :: (Monad m) = (a - m [b]) - [a] - m [b] joinything2 = liftM join `oo` mapM oo is

Re: [Haskell-cafe] (liftM join .) . mapM

2009-12-29 Thread Stephen Tetley
2009/12/29 David Menendez d...@zednenem.com: Why restrict yourself to functions? You can generalize this to arbitrary stacks of functors. oo :: (Functor f, Functor g) = (a - b) - f (g a) - f (g b) oo = fmap . fmap Hi David Nice! this seems to be taking things into TypeCompose territory,

Re: [Haskell-cafe] (liftM join .) . mapM

2009-12-29 Thread Stephen Tetley
Hi Stefan The bird names for combinators stem from Raymond Smullyan's book - To Mock a Mockingbird (this is second-hand knowledge as I don't have my own copy - though I think I've just obliged to get myself one as a post-Christmas treat). The other names B1 B2 and the more common S K I C W etc -

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-29 Thread Stephen Tetley
Hi Günther Have you looked at Daan Leijen's PhD thesis? There's a lot more stuff in it, than was covered in the HaskellDB paper. Best wishes Stephen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-29 Thread Stephen Tetley
Hi Günther The Lambda Calculus Abroad - is Daan Leijen's PhD (so you do already know it...). Best wishes Stephen 2009/12/29 Günther Schmidt gue.schm...@web.de: Hi Stephen, no I haven't, I only know of 2 papers on HaskellDB, chapter 5 from The lambda calculus abroad and a longer version,

Re: [Haskell-cafe] Re: (liftM join .) . mapM

2009-12-29 Thread Stephen Tetley
2009/12/29 Dominic Steinitz domi...@steinitz.org: And oo = (.).(.) and ooo = (.).(.).(.) There was a suggestion a few years back to standardise these as I recall something like:  $0 = $  $1 = .  $2 = (.).(.) and so on but nothing came of it. Hi Dominic Hmm, name-wise I would have to

Re: [Haskell-cafe] pcre-light install fails with undefined reference to _impure_ptr

2009-12-29 Thread Stephen Tetley
For the record... The regex-posix package also failed to build for me with GHC 6.12.1 on Windows with Cygwin due to undefined reference to `_impure_ptr' errors. Again this builds fine with MinGW once you have the GNU regex library installed (its not installed as a default MSys package). With a

Re: [Haskell-cafe] pcre-light install fails with undefined reference to _impure_ptr

2009-12-27 Thread Stephen Tetley
Hi Patrick I think the problem is because PCRE uses c++, and doing a quick web search shows that _impure_ptr link errors are a recurrent problem for the PCRE binding with GHC. Funnily enough 6.10.3 worked fine - I posted to the list a month or two ago with instructions how to do it, but 6.12.1

Re: [Haskell-cafe] pcre-light install fails with undefined reference to _impure_ptr

2009-12-27 Thread Stephen Tetley
2009/12/27 Stephen Tetley stephen.tet...@gmail.com: I'll try next with MinGW to see if that works... Aye, it builds fine under MinGW. I built and installed PCRE (c c++ library) from the source (./configure, make, make install), though I think there is a package available on the msys / MinGW

Re: [Haskell-cafe] Generating AST using Parsec

2009-12-27 Thread Stephen Tetley
Hi Kashyap Algebraic data types in Haskell and other modern functional languages are so convenient for describing syntax trees that you don't have need for a 'tree builder' vis-a-vis Java Tree Builder or JJTree that you might use in Java. The original Parsec distribution has parsers and ASTs for

Re: [Haskell-cafe] Installing Haskell on Windows 7

2009-12-27 Thread Stephen Tetley
Hi Thomas I suspect the problem you are having is specifically with Pandoc. Pandoc has a couple of dependencies on C libraries: network and zlib are two - they are part of the Haskell platform so they would be working in the first place (I have a mostly vanilla install of Haskell platform on

Re: [Haskell-cafe] Re: Installing Haskell on Windows 7

2009-12-27 Thread Stephen Tetley
2009/12/27 Thomas Hühn x...@arcor.de: network gave me a hard time without the Haskell Platform as well. Hi Thomas Network installed for me without a hitch via MinGW for 6.12.1 (via the old skool process of runhaskell Setup.hs ...). MinGW becomes all but essential once you start installing

Re: [Haskell-cafe] : cabal install SDL

2009-12-27 Thread Stephen Tetley
2009/12/27 Lie Ryan lie.1...@gmail.com: [SNIP...] (i.e. can I use the resultant SDL-binding outside Cygwin?) Hi The short answers is yes - once you have the Haskell binding installed will need only the .exe of your (Haskell) application compiled by GHC and the SDL.dll [1]. The long answer

Re: [Haskell-cafe] Re: Installing Haskell on Windows 7

2009-12-27 Thread Stephen Tetley
2009/12/27 Thomas Hühn x...@arcor.de: Okay, then I'll do that. I suppose the mingw that GHC ships is an abridged one, so that setting some environment variables does not suffice? Hi Thomas GHC ships with the compiler (gcc), the binutils (linker, ar etc.) and not much else.

Re: [Haskell-cafe] Why does HXT use Arrows?

2009-12-24 Thread Stephen Tetley
Hello Gregory I've never used HXT, but looking at the source there are many functions with types like this one: getElemNodeSet :: ArrowXml a = a XmlTree XmlTree - a XmlTree XmlNodeSet They are functions where the arrow is 'a XmlTree _something_. The input to the arrow is an XmlTree

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-22 Thread Stephen Tetley
2009/12/22 Eduard Sergeev eduard.serg...@gmail.com: As was previously noted they are supposed to be replaced by type families, Hi Eduard Currently this seems a more like a rumour than a fact - from [1] Type Families and Fun Deps are equivalently expressive which seems a worthwhile point to

Re: [Haskell-cafe] Are functional dependencies around to stay?

2009-12-21 Thread Stephen Tetley
2009/12/21 Günther Schmidt gue.schm...@web.de: What I understand of Haskell is that it's not so much engineered like other languages but more derived from Math, well the very foundations anyway. But some things I can not determine whether or not they are derived from math and thus will stay,

Re: [Haskell-cafe] Design question

2009-12-17 Thread Stephen Tetley
Ohhh... SVG is a truly horrible format though, that almost completely disguises the fact you are working with geometry. Being rude about the designers, its as if they realized half way through the job that putting a function-free PostScript into angle brackets was far too verbose, so they added

Re: [Haskell-cafe] lhs2tex, Haskell Platform and cygwin

2009-12-17 Thread Stephen Tetley
Hi Jacques Does it install properly by the runhaskell Setup.hs configure / build / install? I re-installed it this way a couple of weeks ago and it never mentioned mktexlsr. From a runhaskell Setup.hs ... install it did have a couple of problems which don't relate to your problem but seem worth

Re: [Haskell-cafe] lhs2tex, Haskell Platform and cygwin

2009-12-17 Thread Stephen Tetley
2009/12/17 Jacques Carette care...@mcmaster.ca: mktexlsr is a /bin/sh script, so it's quite natural that an Exec on that would fail.  So I'm still stuck. Ah ha - yes running mktexlsr is an optional step on page 5 of the lhs2TeX manual necessary to get the poly style. I tried a couple of hacks

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-16 Thread Stephen Tetley
2009/12/16 Jason Dusek jason.du...@gmail.com: What is the relationship between the Parsec API, Applicative and Alternative? Is the only point of overlap `|`? Hello everyone, Lots of functions in Text.ParserCombinators.Parsec.Combinator can be defined with only with an obligation on

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-16 Thread Stephen Tetley
Hi Jason UU parsing somewhat invented the Applicative style - it defined the usual combinators from Control.Applicative ($), (*), (*), (*) etc. but didn't have an 'Applicative' type class. By obligation, I mean relying only on the Applicative class for the derived operations, here manyTill,

Re: [Haskell-cafe] What about adding a wiki for each haskell project?

2009-12-13 Thread Stephen Tetley
Hello everyone, Could a new mailing list for patches and/or commentary do the work of the proposed package Wikis? Similar to the libraries list but separate so it doesn't pollute the libraries list from its important job of discussing and refining the core libs. From my perspective, mails have

Re: [Haskell-cafe] What about adding a wiki for each haskell project?

2009-12-13 Thread Stephen Tetley
2009/12/13 Ketil Malde ke...@malde.org: wren ng thornton w...@freegeek.org writes: That's a separate issue isn't it? Why not have an adopt-a-package program where the community determines which packages are orphaned and sets up and maintains wikis and other resources for them until a new

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

2009-12-12 Thread Stephen Tetley
2009/12/12 Tom Tobin korp...@korpios.com: 1) Can the author of Y legally distribute the *source* of Y under a non-GPL license, such as the 3-clause BSD license or the MIT license? Hello Tom If the answer to this isn't yes, I'll buy a hat and eat it... As source, Y (the BSD3 library) can

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

2009-12-12 Thread Stephen Tetley
Hi Thu That would sound like 'private use' to me[1] which is permitted by the GPL. If the client later wanted to *distribute* the agglomerated work the GPL would apply. Distribution being the key point, as at that stage the client is no longer using the agglomeration privately. Best wishes

Re: [Haskell-cafe] Preserving data type information

2009-12-12 Thread Stephen Tetley
Hi Andrey Dynamic types are a possibility, if you want to handle an 'open set' of types: http://www.haskell.org/ghc/docs/6.10.3/html/libraries/base/Data-Dynamic.html http://people.cs.uu.nl/arthurb/dynamic.html Although I don't see your use case as needing heterogeneous lists, section 2 of the

Re: [Haskell-cafe] Why?

2009-12-10 Thread Stephen Tetley
Hello All Paul Hudak's 'Conception, evolution, and application of functional programming languages' gives an account of the motivations, as its only available to ACM members, here are some lengthy quotes: At least a dozen purely functional languages exist along with their implementations. The

Re: [Haskell-cafe] Why?

2009-12-10 Thread Stephen Tetley
2009/12/10 Sebastian Sylvan sebastian.syl...@gmail.com: The killer app for that, IMO, is parallelism these days. Parallelism has been a killer app for quite a long time: Darlington's ALICE running Hope: http://www.chilton-computing.org.uk/acd/dcs/projects/p011.htm Clean was originally

Re: [Haskell-cafe] Re: Why?

2009-12-10 Thread Stephen Tetley
Hello David Apropos the (unfortunately) frosty exchanges that greeted the first release of UHC a couple of months ago, which argued that UHC wasn't Haskell because it didn't implement n+k patterns, one could argue (at least for rhetorical effect) that Haskell plus unsafePerformIO isn't Haskell, I

Re: [Haskell-cafe] Re: Why?

2009-12-10 Thread Stephen Tetley
2009/12/10 David Leimbach leim...@gmail.com: While it's fair to mention that unsafePerformIO is not in the report ... Colin Paul Adams called me out off list and its in the FFI appendum and in Haskell 2010 - I've still got 21 days!. Best wishes Stephen

Re: [Haskell-cafe] Why?

2009-12-10 Thread Stephen Tetley
C'mon Andrew - how about some facts, references? 2009/12/10 Andrew Coppin andrewcop...@btinternet.com: 1. Code optimisation becomes radically easier. The compiler can make very drastic alterations to your program, and not chance its meaning. (For that matter, the programmer can more easily

pexports Was: Re: [Haskell-cafe] binding to C libraries on Windows was Low Level Audio - Writing bytes to the sound card?

2009-12-09 Thread Stephen Tetley
Hi All, Would a pure Haskell version of pexports be useful to the Haskell community? For a Sunday afternoon hack that turned out to take a bit more effort (its now Wednesday), I thought I'd code up a tool that extracts function symbols from .dll's (also when I first looked at the C pexports it

Re: [Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-09 Thread Stephen Tetley
2009/12/9 Andrew Coppin andrewcop...@btinternet.com: I see. So you're saying that while Cygwin is a Unix emulator, MinGW is just a set of Unix-style tools which run natively on Windows? Yes, in a nutshell MinGW executables are native. Executables in Cygwin may or may not have dependencies on

Re: pexports Was: Re: [Haskell-cafe] binding to C libraries on Windows was Low Level Audio - Writing bytes to the sound card?

2009-12-09 Thread Stephen Tetley
-cafe/2009-December/070293.html 2009/12/9 Erik de Castro Lopo mle...@mega-nerd.com: Stephen Tetley wrote: If there are compelling uses that aren't covered by pexports and would ease Haskell C binding problems on Windows, I don't mind polishing up my tool, but otherwise I've exhausted my

Re: [Haskell-cafe] Lisp like symbols in haskell

2009-12-08 Thread Stephen Tetley
Hi Jean-Christophe There is no mention in the 'History of Haskell' which is probably the most authoritative published reference http://research.microsoft.com/en-us/um/people/simonpj/papers/history-of-haskell/index.htm If someone wanted to introduce symbols, they would presumably have to propose

Re: [Haskell-cafe] A bug of groupBy implement

2009-12-07 Thread Stephen Tetley
Could it not be a bug in a) printf b) unsafePerformIO c) d) return e) = f) show g) GHC or GHCi? All of the above? Best wishes Stephen 2009/12/7 L.Guo leaveye@gmail.com: Hi there: My friend asked me a question, and i suppose he has found a bug of `groupBy'. Here is the code piece:

Re: [Haskell-cafe] A bug of groupBy implement

2009-12-07 Thread Stephen Tetley
Hi L.Guo Brent has replied with the right answer. The definition of groupBy is below - the span in the where clause only compares with the first element of the current sub-list: -- | The 'groupBy' function is the non-overloaded version of 'group'. groupBy :: (a - a - Bool) - [a]

Re: [Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-06 Thread Stephen Tetley
Hi Andrew 2009/12/6 Andrew Coppin andrewcop...@btinternet.com: On Windows, it is usual to distribute everything as compiled binaries. (Indeed, for most commercial software, the sources simply aren't available at all.) And users get a binary program and binary DLLs or whatever. Developers

Re: [Haskell-cafe] Low Level Audio - Writing bytes to the sound card?

2009-12-05 Thread Stephen Tetley
Hello Andrew Plenty compile on Windows: Some OpenVG, OpenGL[1] (still? - I'm a bit behind the times) only compile with MinGW. Others are fine with Cygwin provided you have the dev packages installed (readline, pcre-light...). Yet others - no chance... If you can get the raw C library to work

Re: [Haskell-cafe] HP + Gtk2hs?

2009-12-05 Thread Stephen Tetley
2009/12/5 Andrew Coppin andrewcop...@btinternet.com: Interestingly, while you can't compile bindings to external C libraries, Ah Mr Coppin, maybe you should change you to I. I had (Haskell bindings) SDL-0.5.3 working August last year - so I think I would be using GHC 6.8.3 at that time, the

Re: [Haskell-cafe] Low Level Audio - Writing bytes to the sound card?

2009-12-05 Thread Stephen Tetley
Hi Andrew 2009/12/5 Andrew Coppin andrewcop...@btinternet.com: I don't think it should be necessary to install a Unix emulator just so that I can write Windows programs. Maybe others disagree. ... I'm by no means an expert here, but isn't it usual for C libraries on Windows to be

Re: [Haskell-cafe] Low Level Audio - Writing bytes to the sound card?

2009-12-05 Thread Stephen Tetley
Compiling the C PortAudio library for either Cygwin or MinGW will be challenging at the moment. The current release doesn't compile as is, and although there should be patch for the configure script as an attachment to this message it seems to have gone amiss:

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Stephen Tetley
Hi Mike There used to be some slides available commenting on Haskore's CSound interface. But they seem to have vanished (I have a copy rendered to pdf when they were available). Like all slide presentations there's a lot of reading between the lines to get a good picture after the fact:

Re: [Haskell-cafe] Parsec - separating Parsing from Lexing

2009-11-30 Thread Stephen Tetley
Hi Fernando Which version of Parsec are you using, the one that ships with GHC or Parsec 3? I would imagine whichever you one you are using you have the imports wrong for these modules: import Text.Parsec.Pos import Text.Parsec.Prim should be ... import Text.ParserCombinators.Parsec.Pos

[Haskell-cafe] ANN: wumpus-core-0.13.0

2009-11-27 Thread Stephen Tetley
Hello All Wumpus-core is a library for drawing 2D vector pictures, supporting output to PostScript and SVG. It has no FFI dependencies, so should be portable across operating systems (assuming GHC with type families). Wumpus-core is functional, though quite low-level - its similar to PostScript

Re: [Haskell-cafe] ANN: wumpus-core-0.13.0

2009-11-27 Thread Stephen Tetley
Thanks Thu I've two examples on Flickr. These are EPS from Wumpus then turned into JPEG by GraphicsMagick - I don't know any sites that host SVG as SVG. I'll put up more as I draw more: http://www.flickr.com/photos/44929...@n03/ These two also use the unstable 'wumpus-extra' package which is

Re: [Haskell-cafe] I miss OO

2009-11-26 Thread Stephen Tetley
2009/11/26 Eugene Kirpichov ekirpic...@gmail.com: I think two concepts should be separated if one makes sense and is useful without the other. A note out of its time context is certainly useful, for example, it may probably be converted to a MIDI command or to a graphical glyph (which is

Re: [Haskell-cafe] I miss OO

2009-11-26 Thread Stephen Tetley
2009/11/26 Gregg Reynolds d...@mobileink.com: Modeling musical stuff could provide an excellent illustration of the difference between OO and the Haskell way; it's the difference between metaphysical engineering and constructive mathematics. Hmm, Stephen Travis Pope's SmOKe - a design that

Re: [Haskell-cafe] instance Binary UTCTime (Was: Oprhan instances)

2009-11-26 Thread Stephen Tetley
Hello All For instances on UTCTime - isn't UTCTime more 'canoncial' than data-binary etc. by virtue of it being in the Hierarchical Libraries? Thus data-binary should provide an instance of Binary for UTCTime - rather than Time provide a Binary instance. Also, aside from cases where automatic

Re: [Haskell-cafe] Status of TypeDirectedNameResolution proposal?

2009-11-19 Thread Stephen Tetley
2009/11/18 Twan van Laarhoven twa...@gmail.com: The TDNR proposal really tries to do two separate things:  1. Record syntax for function application.    The proposal is to tread x.f or a variation thereof the same as (f x)  2. Type directed name lookup.    The proposal is to look up

Re: [Haskell-cafe] help with musical data structures

2009-11-15 Thread Stephen Tetley
Hello Mike A pitch class set represents Z12 numbers so I'd define a Z12 number type then store it in a list (if you have need a multiset - duplicates) or Data.Set (if you need uniqueness). Having a Z12 numeric type isn't the full story, some operations like finding prime form have easier

Re: [Haskell-cafe] help with musical data structures

2009-11-15 Thread Stephen Tetley
Postscript... Hi Mike I rather overlooked your efficiency concerns, however I wouldn't be so concerned. By the nature of what they represent I wouldn't expect pitch classes to grow to a size where a bit representation out weighs the convenience of a list or Data.Set. By the same reason - I'd

Re: [Haskell-cafe] help with musical data structures

2009-11-15 Thread Stephen Tetley
2009/11/15 Henning Thielemann lemm...@henning-thielemann.de: In Haskore there is a type for pitch classes: http://hackage.haskell.org/packages/archive/haskore/0.1/doc/html/Haskore-Basic-Pitch.html  but maybe it is not what you need, since it distinguishes between C sharp and D flat and so

Re: [Haskell-cafe] help with musical data structures

2009-11-15 Thread Stephen Tetley
Hi Mike Try it and time it of course - there are a couple of libraries to help memo-izing on Hackage. Never having used them, but looking at the docs neither data-memocombinators or MemoTrie would seem to be straightforward for Data.Set, so a Word32 or some other number that is an instance of

Re: [Haskell-cafe] Some thoughts about Hackage

2009-11-14 Thread Stephen Tetley
2009/11/14 Felipe Lessa felipe.le...@gmail.com: Probably adding markers to the comment area every time a new version is added is also a nice idea because a problem in the comment are may be corrected.  The marker would serve as a visual aid that the comment may be outdated. It would be nice

Re: [Haskell-cafe] Could someone teach me why we use Data.Monoid?

2009-11-13 Thread Stephen Tetley
2009/11/13 Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com: Monoid is the category of all types that have a empty value and an append operation. Or more generally a neutral element and an associative operation: The multiplication monoid (1,*) 9*1*1*1 = 9 1 is neutral but

Re: [Haskell-cafe] Could someone teach me why we use Data.Monoid?

2009-11-13 Thread Stephen Tetley
2009/11/13 Magnus Therning mag...@therning.org: On Fri, Nov 13, 2009 at 4:52 PM, Andrew Coppin andrewcop...@btinternet.com wrote: This is the thing. If we had a class specifically for containers, that could be useful. If we had a class specifically for algebras, that could be useful. But a

Re: [Haskell-cafe] Could someone teach me why we use Data.Monoid?

2009-11-13 Thread Stephen Tetley
Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: That is OK. Since understand the basic concept of monoid (I mean the thing in actual math), the idea here is totally not hard for me. But the sample here does not show why (or how) we use it in programming, right? Hi Magicloud

Re: [Haskell-cafe] Could someone teach me why we use Data.Monoid?

2009-11-13 Thread Stephen Tetley
Hi Edward Many thanks. I've mostly used groupoid for 'string concatenation' on types that I don't consider to have useful empty (e.g PostScript paths, bars of music...), as string concatenation is associative it would have been better if I'd used semigroup in the first place (bounding box union

Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-11 Thread Stephen Tetley
Hi Henning I spotted that (and also that Clean doesn't have sections) after my blood pressure returned to normal. Best wishes Stephen [2,4,8] I think they wanted square numbers, not powers of two. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Stephen Tetley
Hello Gregory and Philippos Gregory, methinks you are a unix user as Cabal gives you a carefree existence (the scare quotes do highlight that it's not poor Cabal's fault). Philippos, the problems you are having aren't which cabal per-se but Haskell libraries that bind C libraries. On Windows I

Re: [Haskell-cafe] Cabal

2009-11-09 Thread Stephen Tetley
2009/11/9 Duncan Coutts duncan.cou...@googlemail.com: That should work, and probably the recommendation should be for cygwin users to edit their cabal config to at add C:\cygwin\lib and C:\cygwin \usr\include as standard. Hi Duncan That would definitely be the best idea, but where does the

Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-08 Thread Stephen Tetley
Why speak nonsense when you can test it? // module nonsense import StdEnv nonsense = map ((^) 2) Start = nonsense [1,2,3] // Running

Re: [Haskell-cafe] Re: What's the deal with Clean?

2009-11-08 Thread Stephen Tetley
My impression is the saturated-ness that Doaitse speaks of is covered in Urban Boquist's phd thesis on the GRIN intermediate language - circa page 31. http://www.cs.chalmers.se/~boquist/phd/ As per the code snippet above Clean handles partial application entirely adequately. Best wishes

Re: [Haskell-cafe] Card games

2009-11-07 Thread Stephen Tetley
Hi Felipe Close (or maybe not...), Martin Erwig and Eric Walkingshaw have a few papers on embedding a DSL in Haskell for game theory available from Martin's web site: http://web.engr.oregonstate.edu/~erwig/papers/abstracts.html Best wishes Stephen 2009/11/7 Felipe Lessa

Re: [Haskell-cafe] What's the deal with Clean?

2009-11-03 Thread Stephen Tetley
2009/11/3 Andrew Coppin andrewcop...@btinternet.com: As far as I can tell, Clean is to Haskell as C is to Pascal. I.e., Clean is notionally very similar to Haskell, but with lots of added clutter, complexity and general ugliness - but it's probably somehow more machine-efficient as a result.

Re: [Haskell-cafe] Re: uu-parsinglib pKeyword

2009-10-28 Thread Stephen Tetley
One of the parser combinator libraries for Clean had the (:) combinator that captures the idiom (sorry!) in Doaitse's version. Defined applicatively it would be: (:) :: Applicative f = f a - f [a] - f [a] (:) p1 p2 = (:) $ p1 * p2 so pToken would be pToken [] = pSucced [] pToken (x:xs) =

Re: [Haskell-cafe] Haskell for Physicists

2009-10-02 Thread Stephen Tetley
Hi Edgar No-one seems to have pointed you to the Maestro: http://users.info.unicaen.fr/~karczma/arpap/ The quantum mechanics one might be the most directly useful, but they are all great reads: http://users.info.unicaen.fr/~karczma/arpap/hasiqm.pdf Best wishes Stephen 2009/9/30

Re: [Haskell-cafe] Mapping over multiple values of a list at once?

2009-08-27 Thread Stephen Tetley
Hi Max How about a paramorphism? slideAvg3 :: [Int] - [Int] slideAvg3 = para phi [] where phi x ((y:z:_),acc) = average3 x y z : acc phi x (_,acc) = acc -- helpers -- paramorphism (generalizes catamorphism (fold)) para :: (a - ([a], b) - b) - b - [a] - b para phi b [] = b para

Re: [Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread Stephen Tetley
Hi Günther The code below should work for your simple example, provided it hasn't lost formatting when I pasted it in to the email. I was a bit surprised that there is no pSatisfy in this library, but there are parsers for digits, lower case, upper case letters etc. in the Examples module that

Re: [Haskell-cafe] Re: Lazy Parsing

2009-05-31 Thread Stephen Tetley
Hi Günther I suspect the problem you were having is that there are various 'parsers' (more correctly 'parser types') defined in Text.ParserCombinators.UU.Parsing and the code you had in your running example didn't always have enough information to allow GHC to pick a particular one. The /test/

Re: [Haskell-cafe] OpenVG: Linker errors with ghc --make, but not with ghci?

2009-03-04 Thread Stephen Tetley
Hi Peter Yes this is definitely a problem with the OpenVG package. Although I wrote the package I don't know enough about the minutiae of Windows .dlls to sort this out directly (even though I did write most of the library on a Windows machine). I could try to and write a cabal+makefile build

Re: [Haskell-cafe] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-02 Thread Stephen Tetley
Hi Jeff Thanks. OpenVG is an interesting bit of kit, however... VGU - the higher level layer - would be hard pressed to be less like Haskell, you draw shapes and lines while passing a path handle around. Also, Shiva-VG - http://sourceforge.net/projects/shivavg - the implementation of OpenVG

Re: [Haskell-cafe] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-01 Thread Stephen Tetley
Hello I've written a Haskell binding to the Shiva-VG OpenVG implementation. Hopefully it should appear on Hackage in the next couple of days - but for the moment it is available here: http://slackwise.org/spt/files/OpenVG-0.1.tar.gz I've tested it on MacOSX leopard and Windows with MinGW /

<    1   2   3   4   5   6