Re: [Haskell-cafe] [Agda] Defining subtraction for naturals

2011-03-17 Thread Nils Anders Danielsson
On 2011-03-17 19:35, wren ng thornton wrote: Dependently typed languages tend to use the second definition because it gives a pure total function (unlike the first) and because it's less obnoxious to use than the third. In Haskell the third would be even more obnoxious. There is a fourth option

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-11-25 Thread Nils Anders Danielsson
On 2010-11-25 01:59, John D. Ramsdell wrote: The irony of this situation is deep. CPSA is a program that analyzes cryptographic protocols in an effort to expose security flaws. To ensure that the program does not crash a user's machine, I have to use a linker option that may expose the user to

[Haskell-cafe] Re: dirs in Emacs/Vim in Cabal

2010-07-01 Thread Nils Anders Danielsson
On 2010-06-30 18:38, Chris BROWN wrote: My question is: Is it possible to allow the emacs/vim scripts that I have know where this directory is automatically? Maybe you could adapt the approach taken by Agda. Agda's Emacs mode is installed using Cabal plus a small script: 1) The Emacs Lisp sour

Re: [Haskell-cafe] Hierachical abstraction

2010-01-29 Thread Nils Anders Danielsson
On 2010-01-29 01:09, Edward Kmett wrote: Luke pretty much nailed the summary of what you can parse using Applicative means. I tend to consider them "codata CFGs", because they can have infinite breadth and depth. However, a 'codata CFG' can handle a much larger class of languages than CFGs. To th

Re: [Haskell-cafe] Hierachical abstraction

2010-01-28 Thread Nils Anders Danielsson
On 2010-01-28 20:31, Luke Palmer wrote: I could be mistaken, but at least there are both Applicative and Arrow parser libraries. I don't know how to classify the language that they parse -- it is not strictly context-free. It corresponds roughly to context-free where certain types of infinite cha

Re: [Haskell-cafe] Cabal

2009-12-17 Thread Nils Anders Danielsson
On 2009-11-09 12:39, Duncan Coutts wrote: You'll be glad to know this is addressed in Cabal-1.8, though not in a fully automatic way. The problem with sharing automatically is knowing when it is safe to do so and when it is not. Each component that shares a source file can use different compiler

Re: [Haskell-cafe] Natural Language Processing

2009-12-10 Thread Nils Anders Danielsson
On 2009-12-10 01:11, John D. Earle wrote: Is Parsec capable of parsing a mildly context sensitive language? I expect that one can parse any decidable language using Parsec. Whether it is convenient to do so is another question. -- /NAD ___ Haskell-Ca

Re: [Haskell-cafe] Parsec-like parser combinator that handles left recursion?

2009-12-10 Thread Nils Anders Danielsson
On 2009-12-10 07:16, o...@okmij.org wrote: There are at least two parser combinator libraries that can deal with *any* left-recursive grammars. Parser combinators are often used to describe infinite grammars (with a finite number of parametrised non-terminals). The library described by Frost et

Re: [Haskell-cafe] Parsec-like parser combinator that handles left recursion?

2009-12-09 Thread Nils Anders Danielsson
On 2009-12-09 18:50, Dan Doel wrote: (Your parsers aren't PEGs, are they? If so, I apologize for the redundancy.) No, my parsers use Brzozowski derivatives. See the related work section of the paper I mentioned for some other parser combinator libraries which can handle (some) left recursive g

Re: [Haskell-cafe] Parsec-like parser combinator that handles left recursion?

2009-12-09 Thread Nils Anders Danielsson
On 2009-12-08 16:11, S. Doaitse Swierstra wrote: In principle it is not possible to parse left-recursive grammars [...] I suspect that this statement is based on some hidden assumption. It /is/ possible to parse many left recursive grammars using parser combinators, without rewriting the gramma

Re: [Haskell-cafe] Re: What *is* a DSL?

2009-10-27 Thread Nils Anders Danielsson
On 2009-10-22 14:44, Robert Atkey wrote: On Sat, 2009-10-10 at 20:12 +0200, Ben Franksen wrote: Since 'some' is defined recursively, this creates an infinite production for numbers that you can neither print nor otherwise analyse in finite time. Yes, sorry, I should have been more careful the

Re: [Haskell-cafe] What *is* a DSL?

2009-10-27 Thread Nils Anders Danielsson
On 2009-10-22 14:56, Robert Atkey wrote: Yes, it might have been that, OTOH I'm sure I saw it in some Haskell code. Maybe I was imagining it. There is some related Haskell code in the Agda repository. Do you know of a characterisation of what languages having a possibly infinite amount of non

Re: [Haskell-cafe] What *is* a DSL?

2009-10-13 Thread Nils Anders Danielsson
On 2009-10-07 17:29, Robert Atkey wrote: A deep embedding of a parsing DSL (really a context-sensitive grammar DSL) would look something like the following. I think I saw something like this in the Agda2 code somewhere, but I stumbled across it when I was trying to work out what "free" applicativ

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-06 Thread Nils Anders Danielsson
On 2009-02-05 15:20, Gregg Reynolds wrote: I think I've just about got monads figured out, but [...] I don't think anyone has mentioned Simon's "Tackling the awkward squad" paper in this thread. This tutorial, which contains a semantics for a subset of IO, should answer some of the questions ra

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 0.4.8

2009-01-09 Thread Nils Anders Danielsson
On 2009-01-09 00:51, Niklas Broberg wrote: - Support for Unicode symbols for e.g. ->. Fixing that would require me to have a Unicode-compliant editor Can't you just use character literals like '\x2192'? -- /NAD This message has been checked for viruses but the contents of an attachment may s

Re: [Haskell-cafe] More accessible papers

2007-11-21 Thread Nils Anders Danielsson
On Wed, 21 Nov 2007, Peter Verswyvelen <[EMAIL PROTECTED]> wrote: > Yes, but why don't researchers just publish their TEX file? You can > regard that as the "source code" for generating PDF/PS whatever no? Typically researchers have to give away the copyright to their papers upon publication. How

Re: [Haskell-cafe] Using type-level programming to tag functions with time and space complexity

2007-11-13 Thread Nils Anders Danielsson
On Thu, 18 Oct 2007, Daniel McAllansmith <[EMAIL PROTECTED]> wrote: > I was wondering if anyone had done work on tagging functions at the type > level > with their time or space complexity and, if it's even feasible, calculating > the complexity of compound functions. > > Any pointers? I have

Re: [Haskell-cafe] agda v. haskell

2007-09-29 Thread Nils Anders Danielsson
On Fri, 28 Sep 2007, Jeff Polakow <[EMAIL PROTECTED]> wrote: > Agda is essentially an implementation of a type checker for > Martin-Lof type theory (i.e. dependent types). > > It is designed to be used as a proof assistant. Well, the language aims to become a practical programming language. U

Re: [Haskell-cafe] Spot the difference!

2007-09-20 Thread Nils Anders Danielsson
On Thu, 20 Sep 2007, PR Stanley <[EMAIL PROTECTED]> wrote: > \_ n -> 1 + n > \_ -> (\n -> 1 + n) > The outcome seems to be identical. is there a substantive difference > between the two definitions? No, since you do not pattern match on the first argument. Otherwise, due to the way these definiti

Re: [Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-14 Thread Nils Anders Danielsson
On Sun, 13 May 2007, Stefan Holdermans <[EMAIL PROTECTED]> wrote: > Anyway, Conor and James' Haskell Workshop paper on manipulating > syntax that involves both free and bound variables [1] is really nice > and could perhaps be of interest to you. If I remember correctly this paper is not about a

Re: [Haskell-cafe] built-in lists vs inductively defined list

2007-05-09 Thread Nils Anders Danielsson
On Wed, 09 May 2007, Stefan O'Rear <[EMAIL PROTECTED]> wrote: > To the best of my knowledge, there are no optimizations specific to [] > in the compiler proper. > > However, the standard library has a *lot* of speed hacks you will need > to duplicate! Some of which are not expressible in "ordinar

Re: [Haskell-cafe] Article review: Category Theory

2007-01-19 Thread Nils Anders Danielsson
On Fri, 19 Jan 2007, Ulf Norell <[EMAIL PROTECTED]> wrote: > Personally I think that the distinction between _|_ and \x -> _|_ is > a mistake and should be ignored whenever possible. If you want to write an accessible tutorial you should probably use a total programming language, or at least the

Re: Resending: [Haskell-cafe] MissingH: profiler support?

2007-01-12 Thread Nils Anders Danielsson
On Thu, 11 Jan 2007, Chris Eidhof <[EMAIL PROTECTED]> wrote: > On 8 Jan, 2007, at 23:13 , Chris Eidhof wrote: > >> I'm trying to profile my application, which makes use of MissingH. >> But when compiling with -prof -auto-all, I get the following error: >> >>> Language.hs:8:7: >>> Could not fin

[Haskell-cafe] Re: Fractional/negative fixity?

2006-11-08 Thread Nils Anders Danielsson
On Wed, 08 Nov 2006, Henning Thielemann <[EMAIL PROTECTED]> wrote: > If the Prelude would be splitted into modules, where (==) and (+) > are separated, and no module imports the other one, then we need a > third module, which states the relation between (==) and (+). Yes, presumably. However, cur

[Haskell-cafe] Re: Fractional/negative fixity?

2006-11-08 Thread Nils Anders Danielsson
On Wed, 08 Nov 2006, "Arie Peterson" <[EMAIL PROTECTED]> wrote: > Specifying precedence 'lazily', by a partial order, does not suffer from > this problem, because it only requires you to make local decisions. Assuming we only want to be able to make local decisions. Let's say that we want == to

Re: [Haskell-cafe] List comparisons and permutation group code

2006-10-19 Thread Nils Anders Danielsson
On Thu, 19 Oct 2006, Tomasz Zielonka <[EMAIL PROTECTED]> wrote: > On Thu, Oct 19, 2006 at 01:37:16PM -0400, Cale Gibbard wrote: > >> In order to determine if [1..length xs] has an element at all, you >> have to evaluate length xs, which involves forcing the entire spine of >> xs, because integers

Re: [Haskell-cafe] Re: Automatic fixity allocation for symbolic operators

2006-10-17 Thread Nils Anders Danielsson
On Mon, 16 Oct 2006, Jón Fairbairn <[EMAIL PROTECTED]> wrote: > I made a more concrete proposal later and Phil Wadler tidied it up. > I think It even got as far as a draft of the language, [...] Do you know where this proposal/draft can be found? -- /NAD ___

Re: [Haskell-cafe] Re: Functional progr., infinity, and the Universe

2006-06-26 Thread Nils Anders Danielsson
On Sat, 24 Jun 2006, Paul Hudak <[EMAIL PROTECTED]> wrote: > Hmmm... never tried to write all this down in one place before, but I > think this covers all cases: > > A partial list is one that ends in _|_. > A total list is one that ends in []. > A finite list is either partial or total. > Any oth

Re: [Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-03 Thread Nils Anders Danielsson
On Sun, 02 Apr 2006, "Jared Updike" <[EMAIL PROTECTED]> wrote: > Something like "distribute fst (==)" where > >> distribute f op x y = f x `op` f y A function like this has been suggested for the standard libraries a couple of times before. Someone suggested the name "on", which I quite like:

Re: [Haskell-cafe] Re: Positive integers

2006-03-24 Thread Nils Anders Danielsson
On Fri, 24 Mar 2006, Henning Thielemann <[EMAIL PROTECTED]> wrote: > Further on think of QuickCheck: A Cardinal type with an Arbitrary > instance would save us the (>=0) condition and it would reduce the > number of tests that must be skipped because of non-fulfilled > conditions. Because I was c

[Haskell-cafe] MUA written in Haskell (was: Getting GHC to print "Done" when it's finished linking?)

2006-03-08 Thread Nils Anders Danielsson
On Tue, 07 Mar 2006, "Brian Hulley" <[EMAIL PROTECTED]> wrote: (Moved from ghc-users.) > Brian Hulley wrote: > (time for a proper email client to be written in Haskell! ;-) ) I had the same thought yesterday, after an Emacs-Lisp session in which I was trying to get Gnus to do exactly what I wan

Re: [Haskell-cafe] Credit Card Authorization code

2006-03-06 Thread Nils Anders Danielsson
On Thu, 02 Mar 2006, "S. Alexander Jacobson" <[EMAIL PROTECTED]> wrote: > I am looking for Haskell code that does credit card authorization? > e.g. paypal website pro does not supply a Haskell lib. I think that WASH/CGI contains code for doing some sort of checksum check on credit card numbers:

Re: [Haskell-cafe] module for probability distributions

2006-03-01 Thread Nils Anders Danielsson
On Thu, 16 Feb 2006, Matthias Fischmann <[EMAIL PROTECTED]> wrote: > I wrote a module for sampling arbitrary probability distribution, so > far including normal (gaussian) and uniform. > - There is probably a better implementation out there already. > Please point me to it. Martin Erwig an

Re: [Haskell-cafe] enforcing strictness on arbitrary subexpressions

2006-03-01 Thread Nils Anders Danielsson
On Thu, 16 Feb 2006, Udo Stenzel <[EMAIL PROTECTED]> wrote: >> hPutStr stdout $ foldr seq veryLongString veryLongString > > There is no primitive to do this for arbitrary data types, but the > DeepSeq type class comes close. You can find DeepSeq and some more > hints on strict evaluation at >

[Haskell-cafe] Enforcing coding policy (was: Why or why not haskell ?)

2005-12-12 Thread Nils Anders Danielsson
On Sun, 11 Dec 2005, Tomasz Zielonka <[EMAIL PROTECTED]> wrote: > I would like to see some support in tools for enforcing such a coding > policy. It could look like this - a function written using only safe > components would be marked as safe. Every unsafe feature like FFI, > unsafePerformIO, etc

[Haskell-cafe] Re: Making Haskell more open

2005-11-11 Thread Nils Anders Danielsson
On Fri, 11 Nov 2005, Tomasz Zielonka <[EMAIL PROTECTED]> wrote: [Moved to cafe.] > How about an integrated newsgroup+mailinglist+forum. If we had a > two-way newsgroup+mailinglist integration, people could use it also > as a forum, for example through gmail.google.com. But I don't use > fora, so

Re: [Haskell-cafe] Detecting Cycles in Datastructures

2005-10-27 Thread Nils Anders Danielsson
On Thu, 27 Oct 2005, Lennart Augustsson <[EMAIL PROTECTED]> wrote: > Tom Hawkins wrote: > >> Or phased differently, is it possible to make "Expr" an instance of >> "Eq" such that cyclic == cyclic is smart enough to avoid a recursive >> decent? > > No. And there is nothing that says that your defi

Re: [Haskell-cafe] Quickcheck examples and Data.Word32

2005-10-27 Thread Nils Anders Danielsson
On Thu, 27 Oct 2005, Sebastian Sylvan <[EMAIL PROTECTED]> wrote: > instance Arbitrary Word32 where > arbitrary = do c <- arbitrary :: Gen Integer > return (fromIntegral c) This definition will usually only generate very small or very large Word32 values. The reason is the wrapp

Re: [Haskell-cafe] Re: Coarbitrary

2005-10-27 Thread Nils Anders Danielsson
On Thu, 27 Oct 2005, Shae Matijs Erisson <[EMAIL PROTECTED]> wrote: > Joel Reymont <[EMAIL PROTECTED]> writes: > >> I could not understand how to define this for arbitraries of my >> choosing and Shae seems to have defined coarbitrary = error "Not >> implemented" :-). > > Coarbitrary is for genera

Re: [Haskell-cafe] Parsing in Practice

2005-10-18 Thread Nils Anders Danielsson
On Tue, 18 Oct 2005, Philippa Cowderoy <[EMAIL PROTECTED]> wrote: > If you've got a decent chunk of test data or don't mind generating > it with QuickCheck odds are you can spot it reasonably quickly when > it happens. When I write a parser I usually also write a pretty-printer (or ugly-printer)

Re: [Haskell-cafe] Re: Alternatives to hs-plugins?

2005-10-07 Thread Nils Anders Danielsson
On Thu, 06 Oct 2005, John Goerzen <[EMAIL PROTECTED]> wrote: > Quick question: am I correct in thinking that this code, while it uses > Hugs, won't actually run from Hugs, due to lack of piping support in > Hugs? Quite possibly. -- /NAD ___ Haskell-C

Re: [Haskell-cafe] Alternatives to hs-plugins?

2005-10-06 Thread Nils Anders Danielsson
On Thu, 06 Oct 2005, John Goerzen <[EMAIL PROTECTED]> wrote: > I'm wondering if there are any alternatives? Can a Haskell program > using Hugs call Hugs to evaluate an arbitrary hunk of code? Although it is not very efficient you can of course call Hugs and parse its output. I have some working

Re: [Haskell-cafe] Confused about types

2005-10-05 Thread Nils Anders Danielsson
On Wed, 05 Oct 2005, Henning Thielemann <[EMAIL PROTECTED]> wrote: > If this shall be more than a disposable example, I suggest to separate > the Newton iteration from the abort of the iteration. There is a related example, demonstrating this technique, in "Why Functional Programming Matters":

Re: [Haskell-cafe] Papers from the 2005 Haskell Workshop (Tallinn)?

2005-10-05 Thread Nils Anders Danielsson
On Wed, 05 Oct 2005, Dimitry Golubovsky <[EMAIL PROTECTED]> wrote: > The papers presented at the Workshop are already available in the ACM > library which requires membership/subscription to read full text PDFs. > Are there any plans to make those papers available anywhere else on > the Web withou

Re: [Haskell-cafe] How to debug GHC

2005-09-01 Thread Nils Anders Danielsson
On Thu, 01 Sep 2005, Frederik Eaton <[EMAIL PROTECTED]> wrote: > But getting a stack backtrace when there is an error should be a > pretty basic feature. It's very hard to debug a large program when you > can randomly get messages like "*** Exception: Prelude.head: empty > list" and have no idea w

[Haskell-cafe] Re: Backwards-Compatibility

2005-07-01 Thread Nils Anders Danielsson
On Wed, 29 Jun 2005, Sven Moritz Hallberg <[EMAIL PROTECTED]> wrote: > Am 29. Jun 2005 um 11.03 Uhr schrieb Simon Marlow: > >> On 28 June 2005 14:11, Bulat Ziganshin wrote: >> >>> [...] how about using Pesco's library versioning scheme? (see >>> http://www.haskell.org/tmrwiki/EternalCompatibilityI