Re: [Haskell-cafe] Wanted: Haskell binding for libbdd (buddy)

2012-08-20 Thread Peter Gammie
On 20/08/2012, at 11:19 PM, Johannes Waldmann wrote: Are there any Haskell bindings for BDD libraries (reduced ordered binary decision diagrams)? E.g., it seems buddy is commonly used http://packages.debian.org/squeeze/libbdd-dev and it has an Ocaml binding. My hBDD bindings are on

Re: [Haskell-cafe] Why does (++ !) bla return bla! and not !bla?

2012-06-21 Thread Peter Gammie
Hilco, On 22/06/2012, at 2:54 PM, Hilco Wijbenga wrote: I'm going through the excellent http://learnyouahaskell.com tutorial. So far it's been pretty easy to follow but now I ran into something that (when I later started reading about maps) do not seem to fully grasp. I think I'm close to

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Peter Gammie
Christopher, On 16/03/2012, at 11:23 PM, Christopher Svanefalk wrote: there is a question I have been thinking about a bit. In short, we could simply formulate it like this: Are there any problems which cannot be solved a side effect-free language (such as Haskell)? In other words, are

Re: [Haskell-cafe] Functor in terms of Arrow

2012-02-18 Thread Peter Gammie
Tom, On 19/02/2012, at 3:21 AM, Tom Schouten wrote: Does AFunctor below have a standard name? It's a generalization of the Functor class in terms of Arrow instead of (-): fmap :: Functor f = (i - o) - f i - f o afmap :: Arrow a, AFunctor f = a i o- a (f i) (f o)

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-06 Thread Peter Gammie
Ben, On 07/10/2011, at 8:55 AM, Benjamin Redelings I wrote: My question is, roughly, is there already an existing framework for incremental evaluation in Haskell? Margnus Carlsson did something monadic several years ago. http://dl.acm.org/citation.cfm?doid=581478.581482 Perhaps there is

Re: [Haskell-cafe] Is Harper right that Haskell cannot model the natural numbers?

2011-05-02 Thread Peter Gammie
On 03/05/2011, at 1:25 PM, Richard O'Keefe wrote: In one of his blog posts, Robert Harper claims that the natural numbers are not definable in Haskell. SML datatype nat = ZERO | SUCC of nat Haskell data Nat = Zero | Succ Nat differ in that the SML version has strict constructors,

Re: [Haskell-cafe] How to keep cabal and ghci package versions in sync?

2011-04-26 Thread Peter Gammie
On 27/04/2011, at 3:04 AM, Rogan Creswick wrote: At the moment, cabal-dev ghci just uses the -package-conf and -no-user-package-conf flags to restrict ghci to the sandboxed and global package dbs. It's difficult to do more without parsing the content of the project's cabal file, and that

Re: [Haskell-cafe] Asynchronous Arrows need Type Specialization - Help!

2011-03-22 Thread Peter Gammie
David, On 21/03/2011, at 4:18 PM, David Barbour wrote: I was giving Control.Arrow a try for a reactive programming system. The arrows are agents that communicate by sending and returning time-varying state. Different agents may live in different 'vats' (event-driven threads) to roughly model

Re: [Haskell-cafe] lambda calculus and equational logic

2010-07-13 Thread Peter Gammie
Ben, comments from the peanut gallery: On 13/07/2010, at 11:51 PM, Ben Lippmeier wrote: What kind of equality do you use for getChar :: IO Char ? Surely this is easy: getChar denotes a particular IO action, which is always the same thing (i.e. self-identical and distinct from all other IO

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-28 Thread Peter Gammie
Ben, On 29/04/2010, at 6:16 AM, Ben wrote: [...] newtype STAuto s a b = STAuto { unSTAuto : (a, s) - (b, s) } As Felipe observes in detail, this can be made to work. He uses Read and Show for serialisation, but clearly you can use whatever you like instead. I just wanted to add that one

Re: [Haskell-cafe] Bulk Synchronous Parallel

2010-04-21 Thread Peter Gammie
On Thu, Apr 22, 2010 at 4:07 AM, Aaron D. Ball aarondball+hask...@gmail.com wrote: I don't need a tool that automatically figures out how to distribute any workload in an intelligent way and handles all the communication for me.  If I have the basic building block, which is the ability to

Re: [Haskell-cafe] Beginning of a meta-Haskell [was: An issue with the ``finally tagless'' tradition]

2009-09-24 Thread Peter Gammie
Thanks Oleg! Brad: On 24/09/2009, at 3:54 PM, o...@okmij.org wrote: and interpret it several times, as an integer -- testpw :: Int testpw = (unR power) (unR 2) ((unR 7)::Int) -- 128 My type function allows one to remove the '::Int' annotation, which is especially useful in situations

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-23 Thread Peter Gammie
Brad: On 24/09/2009, at 11:59 AM, excerpts of what Brad Larsen wrote: We then try to define an evaluator: -- instance PolyArithExpr E where -- constant = E -- addP e1 e2 = E (eval e1 + eval e2) -- bzzt! The instance definition for `addP' is not type correct: Could not deduce (Num

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-23 Thread Peter Gammie
Brad, On 24/09/2009, at 2:45 PM, Brad Larsen wrote: On Thu, Sep 24, 2009 at 12:22 AM, Peter Gammie pete...@gmail.com wrote: [...] Ambiguity is IMHO best handled with a judicious application of type (or data) families, but you can get surprisingly far by simply requiring that every class

Re: [Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-27 Thread Peter Gammie
On 28/07/2009, at 11:35 AM, Richard O'Keefe wrote: It's true that the abstract speaks of a more biological scheme of protected universal cells interacting only through messages that could mimic any desired behavior, but that's basically _it_ for biology, if we are to believe Kay, and even then,

Re: [Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-27 Thread Peter Gammie
On 28/07/2009, at 12:59 PM, Richard O'Keefe wrote: On Jul 28, 2009, at 2:25 PM, Peter Gammie wrote: But Richard (or am I arguing with Kay?) - monads don't interact. You're arguing with Alan Kay here: the reference to Leibniz was his. The key link here is (Wikipedia): Leibniz allows just

[Haskell-cafe] TBC: Testing By Convention

2009-07-26 Thread Peter Gammie
Hello, Mark and I would like to announce our test harness, which has features complementary to existing harnesses. TBC provides two main features: - It attempts to compile and run all tests, even if some do not compile or run. - Aspiring to the write-it-once principle, tests following

Re: [Haskell-cafe] TBC: Testing By Convention

2009-07-26 Thread Peter Gammie
On 27/07/2009, at 2:26 PM, Alexander Dunlap wrote: Can it return an exit status based on whether or not all tests passed? If not, that would be a very useful feature that I have not seen in any other testing frameworks. It could, and that's probably true of the other harnesses out there. The

Re: [Haskell-cafe] [ANNOUNCE] Bindings for libguestfs

2009-05-13 Thread Peter Gammie
Richard, I remember having similar problems to you when trying to use the FFI. The following comments are suggestions as to what helps in practice, and not a claim that the situation can't be improved. On 13/05/2009, at 8:40 PM, Richard W.M. Jones wrote: Specific things would be:

Re: [Haskell-cafe] Problems with Validate from HaXML

2008-06-12 Thread Peter Gammie
Hello, I have the same problems. I believe I sent Malcolm some patches. If not, look here: http://peteg.org/haskell/HaXml/ I am away from my laptop right now so I cannot readily tell you whether a darcs get will do the job. In any case, there is a bug in the DTD parser that is easily fixed.

Re: [Haskell-cafe] Re: What is the maturity of Haskell Web Frameworks

2008-06-05 Thread Peter Gammie
On 05/06/2008, at 5:31 PM, apfelmus wrote: WASH/CGI has something in that direction. I don't know a short introduction, but have a look at sections 4 and 8 of the implementation notes http://www.informatik.uni-freiburg.de/~thiemann/WASH/draft.pdf I think there is also some work done

Re: [Haskell-cafe] Ghc / cgi static linking

2008-06-01 Thread Peter Gammie
On 02/06/2008, at 5:26 AM, Don Stewart wrote: pieter: Yes, it is entirely possible to statically link entire CGI apps. You might want to watch out for a bug in GHC 6.8.2 that means GHC's - static flag doesn't work. (At least for me, at least on Debian: the - lpthread flag is passed before

Re: [Haskell-cafe] Re: the Network.URI parser

2008-05-28 Thread Peter Gammie
On 28/05/2008, at 12:28 PM, Miguel Mitrofanov wrote: I am taking comments on a web forum from arbitrary people. The interpretation of the HTML occurs at the user's browser. A lot of people will be using outdated browsers (IE 5.5 / 6), ergo security (at the source) becomes my problem. I

[Haskell-cafe] Re: static linking

2008-05-28 Thread Peter Gammie
from darcs, perhaps? BTW when I said move to the end, I meant move to the end of -l flags. cheers peter On 27/05/2008, at 10:37 AM, Peter Gammie wrote: Hello, I am having a bit of trouble static linking my program using GHC 6.8.2. In brief: rt uses pthread, but -lrt is the final thing

[Haskell-cafe] Re: the Network.URI parser

2008-05-27 Thread Peter Gammie
On 27/05/2008, at 6:08 PM, Neil Mitchell wrote: It most certainly is a security flaw. In the src of an img, yes, probably. In the href of a link, its a completely valid thing to do - and one that I've done loads of times. The URI is fine, its just the particular location that is dodgy.

[Haskell-cafe] library for drawing charts

2008-05-24 Thread Peter Gammie
Hello, Has anyone got some code for drawing charts? I don't mean graphs of functions, ala http://dockerz.net/twd/HaskellCharts and I don't mean calls to the Google Charts API ala http://community.livejournal.com/evan_tech/241080.html I would like something that can generate PNGs in memory,

[Haskell-cafe] Re: HaXml and the XHTML 1.0 Strict DTD

2008-05-21 Thread Peter Gammie
On 30/04/2008, at 5:32 PM, Malcolm Wallace wrote: Peter Gammie [EMAIL PROTECTED] wrote: The most-recent darcs version relies on a newer ByteString than I have, so it is not easy for me to test it. I believe there was a patch to fix this. Apparently only one version of the bytestring

[Haskell-cafe] Re: HaXml and the XHTML 1.0 Strict DTD

2008-05-21 Thread Peter Gammie
On 21/05/2008, at 5:44 PM, Malcolm Wallace wrote: Peter Gammie [EMAIL PROTECTED] wrote: !ELEMENT table (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+)) Using a slightly hacked HaXml v1.13.3, I get this from DtdToHaskell: data Table = Table Table_Attrs (Maybe Caption

Re: [Haskell-cafe] another Newbie performance question

2008-05-18 Thread Peter Gammie
You want to lazily read a CSV file? I had a crack at writing a module for that: http://peteg.org/blog/AYAD/Project/2008-04-11-LazyCSVParser.autumn It is not quite RFC compliant (I believe that is clearly commented upon). As I say there, anything based on (older versions of) Parsec is

Re: [Haskell-cafe] FFI Query: How to free a CString allocated in Haskell

2008-04-29 Thread Peter Gammie
On 29/04/2008, at 12:58 PM, Brandon S. Allbery KF8NH wrote: On Apr 29, 2008, at 1:45 , Verma Anurag-VNF673 wrote: A naïve question I have now after reading your mail. How do I call MarshallAlloc.free from my C code because that's where I need to free it? Provide a Haskell wrapper function

[Haskell-cafe] HaXml and the XHTML 1.0 Strict DTD

2008-04-28 Thread Peter Gammie
Is anyone using HaXml to validate XHTML Strict? The old 1.13.2 version has some bugs in how it handles attributes that stop me from using it. It handled the DTD parsing fine. The most-recent darcs version relies on a newer ByteString than I have, so it is not easy for me to test it. A

Re: [Haskell-cafe] FFI Query: How to free a CString allocated in Haskell

2008-04-28 Thread Peter Gammie
On 28/04/2008, at 7:23 PM, Bulat Ziganshin wrote: Hello Verma, Monday, April 28, 2008, 4:11:51 PM, you wrote: newCString str Now once I call this function from C code, I am freeing the allocated memory using free function. I want to confirm that this is the right thing to do. yes,

Re: [Haskell-cafe] Re: HDBC, character encoding

2008-04-04 Thread Peter Gammie
On 03/04/2008, at 9:10 PM, John Goerzen wrote: On 2008-04-01, Peter Gammie [EMAIL PROTECTED] wrote: I added some stuff to HSQL (not HDBC) and HaskellDB so that UTF8 can be used to talk to the database. It's not very pretty though, so I haven't tried to get it merged. Do you have a diff

Re: [Haskell-cafe] Re: HDBC, character encoding

2008-04-04 Thread Peter Gammie
On 04/04/2008, at 9:27 PM, John Goerzen wrote: I can see this being a performance and ease-of-use win in some situations. I don't think it's an actual feature difference, though. If you can represent it as a [Word8], you can represent it as a [Char], and it will be converted to the same

Re: [Haskell-cafe] HDBC, character encoding

2008-03-31 Thread Peter Gammie
On 31/03/2008, at 11:42 PM, Bjorn Bringert wrote: 2008/3/26 Adrian Neumann [EMAIL PROTECTED]: Hi, I wrote a CGI program to access a Postgres database using HDBC. [...] I think that Peter Gammie (copied) has some code to deal with this. I added some stuff to HSQL (not HDBC) and HaskellDB

Re: [Haskell-cafe] modeling ANSI C structs in Haskell?

2008-02-04 Thread Peter Gammie
Vasili, On 04/02/2008, at 10:04 PM, Galchin Vasili wrote: I am reading through the FFI doc. Any suggestions on enabling Haskell programmers to model ANSI C structs that will be passed down to C run-time? The FFI spec is a wonderful document, but is of limited use in learning to

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-28 Thread Peter Gammie
On 28/12/2007, at 4:21 PM, Miguel Mitrofanov wrote: How can I test that partial order in Haskell ? You can't. It's kinda internal. More specifically, if you try to compute a value, which is not maximal in this order, you'll get an error or loop forever. But you still can use such values

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-28 Thread Peter Gammie
On 28/12/2007, at 5:50 PM, Miguel Mitrofanov wrote: Right, so when I say to GHCi: Prelude take 5 [1..] and it says: [1,2,3,4,5] then it really has computed the entirety of the infinite sequence [1..], and not some approximation? Of course not! In fact, it doesn't even compute

Re: [Haskell-cafe] Re: Wikipedia on first-class object

2007-12-28 Thread Peter Gammie
On 28/12/2007, at 7:19 PM, Miguel Mitrofanov wrote: So what do you expect: take 5 [1,2,3,4,5,undefined] to do? Nothing! It's a value, not an instruction! Dang, I knew I'd choose at least one wrong word in all of that. :-P What is it's value, then? ... and what is the value of the

[Haskell-cafe] Sending email from a Haskell program

2007-09-26 Thread Peter Gammie
Hello, Does anyone have a library for sending email from a Haskell program? I'd like something portable and cabalised. I note there is code in darcs to send email on Windows and UNIX-y systems, and also something in WASH (I know not what). Apparently there is an SMTP server of some kind

Re: [Haskell-cafe] Re: Does laziness make big difference?

2007-02-15 Thread Peter Gammie
Nick, Roughly, I'd say you can fudge laziness in data structures in a strict language without too much bother. (I don't have much experience with this, but the existence of a streams library for OCaml is the sort of thing I mean. There are plenty of papers on co- iterative streams and