getWorkingDirectory/changeWorkingDirectory

2013-12-04 Thread Benjamin Franksen
Module System.Posix.Directory of the unix package defines getWorkingDirectory :: IO FilePath changeWorkingDirectory :: FilePath - IO () I believe the functionality is quite portable and not limited to unix-like systems. I know that e.g. Windows has chdir and getcwd. Module Filesystem of

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-15 Thread Benjamin Franksen
Ertugrul Söylemez wrote: damodar kulkarni kdamodar2...@gmail.com wrote: The Monad class makes us define bind (=) and unit (return) for our monads. Why the Kleisli composition (=) or (=) is not made a part of Monad class instead of bind (=)? Is there any historical reason behind this? The

Re: [Haskell-cafe] Efficient mutable arrays in STM

2011-10-28 Thread Benjamin Franksen
David Barbour wrote: Create an extra TVar Int for every `chunk` in the array (e.g every 256 elements, tuned to your update patterns). Read-write it (increment it, be sure to force evaluation) just before every time you write an element or slice it or slice the array element. Incrementing and

[Haskell-cafe] Re: ANNOUNCE: darcs 2.5 beta 4

2010-08-25 Thread Benjamin Franksen
Benjamin Franksen wrote: I have trouble building this latest beta. I found that the build uses ghc-6.8.3 which, I think, is no longer supported for building darcs, IIRC. Sorry for the noise. Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] Re: ANNOUNCE: darcs 2.5 beta 3

2010-08-19 Thread Benjamin Franksen
This beta has a bug. This is what just happened to me: frank...@aragon:~/ctl/MLS-Controls/clean ___ 13:27:51 darcs push Pushing to /srv/csr/repositories/controls/darcs/epics/ioc/MLS- Controls/base-3-14... Tue Aug 17 15:20:42 CEST 2010 benjamin.frank...@bessy.de

[Haskell-cafe] Re: Approaches to dependent types (DT)

2010-01-11 Thread Benjamin Franksen
pbrowne wrote: Dependent Types (DT) The purpose of dependent types (DT) is to allow programmers to specify dependencies between the parameters of a multiple parameter class. 'Dependent type' means result type (of a function) can depend on argument values. This is not (directly) supported in

Re: Takusen build error

2008-07-02 Thread Benjamin Franksen
Alistair Bayley wrote: I get a strange error building Takusen (more precisely: the module Foreign/C/UTF8.hs) with ghc-6.8.3. It says [1 of 9] Compiling Foreign.C.UTF8 ( Foreign/C/UTF8.hs, dist/build/Foreign/C/UTF8.o ) /tmp/ghc18936_0/ghc18936_0.s: Assembler messages:

Takusen build error

2008-06-30 Thread Benjamin Franksen
I get a strange error building Takusen (more precisely: the module Foreign/C/UTF8.hs) with ghc-6.8.3. It says aragon: .../ghc-6.8.3/Takusen-0.8.1 ./Setup build -v Reading parameters from /srv/projects/ctl/franksen/haskell/ghc-6.8.3/Takusen-0.8.1/takusen.buildinfo Creating dist/build (and its

Re: ghc-6.8.3 binary dist problem

2008-06-27 Thread Benjamin Franksen
Ian Lynagh wrote: On Thu, Jun 26, 2008 at 02:51:05PM +0200, Benjamin Franksen wrote: aragon: .../i386-unknown-linux/ghc-6.8.3 utils/pwd/pwd forwardslash [1]28489 floating point exception utils/pwd/pwd forwardslash This happens when your system (libc?) is too old to run the binaries

ghc-6.8.3 binary dist problem

2008-06-26 Thread Benjamin Franksen
When I try to ./configure, I get this error: aragon: .../i386-unknown-linux/ghc-6.8.3 ./configure --prefix=/projects/ctl/franksen/usr checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu Which we'll

[Haskell-cafe] Re: Building production stable software in Haskell

2007-09-17 Thread Benjamin Franksen
Philippa Cowderoy wrote: On Mon, 17 Sep 2007, Adrian Hey wrote: Ideally the way to deal with this is via standardised interfaces (using type classes with Haskell), not standardised implementations. Even this level of standardisation is not a trivial clear cut design exercise. e.g we currently

[Haskell-cafe] Re: Help understanding type error

2007-09-10 Thread Benjamin Franksen
Derek Elkins wrote: On Sat, 2007-09-08 at 12:24 +1000, Stuart Cook wrote: On 9/8/07, Ryan Ingram [EMAIL PROTECTED] wrote: This does what you want, I think: {-# LANGUAGE ExistentialQuantification #-} module Exist where data Showable = forall a. (Show a) = Showable a instance Show

[Haskell-cafe] Re: Extending the idea of a general Num to other types?

2007-09-07 Thread Benjamin Franksen
Dan Piponi wrote: On 9/5/07, Ketil Malde [EMAIL PROTECTED] wrote: On Wed, 2007-09-05 at 08:19 +0100, Simon Peyton-Jones wrote: Error message from GHCi: test/error.hs:2:8: No instance for (Num String) arising from use of `+' at test/error.hs:2:8-17 Possible fix:

[Haskell-cafe] Re: Block-wise lazy sequences in Haskell

2007-09-07 Thread Benjamin Franksen
Bryan O'Sullivan wrote: Henning Thielemann wrote: I thought it must be possible to define an unboxed array type with Storable elements. Yes, this just hasn't been done. There would be a few potentially tricky corners, of course; Storable instances are not required to be fixed in

[Haskell-cafe] Re: Learn Prolog...

2007-09-02 Thread Benjamin Franksen
Hugh Perkins wrote: Sooo.. what is the modern equivalent of Prolog? I once learned about LIFE (Logic, Inheritance, Functions, and Equations) and was deeply fascinated. However, it died the quick death of most research languages. Cheers Ben ___

[Haskell-cafe] Re: RE: Definition of the Haskell standard library

2007-09-01 Thread Benjamin Franksen
Sven Panne wrote: On Tuesday 31 July 2007 19:39, Duncan Coutts wrote: [...] The docs for those packages would be available for packages installed via cabal (assuming the user did the optional haddock step) and would link to each other. Well, on a normal Linux distro a user should *never*

[Haskell-cafe] RE: Re: Remember the future

2007-08-25 Thread Benjamin Franksen
Simon Peyton-Jones wrote: | From the ghc manual: | | --- | 7.3.3. The recursive do-notation | ... | | It is unfortunate that the manual does not give the translation rules, or at | least the translation for the given example. Hmm. OK. I've improved the manual with a URL to

[Haskell-cafe] Re: Haskellnet could not find network-any dependency.

2007-08-25 Thread Benjamin Franksen
Edward Ing wrote: Hi, I am trying to install Haskellnet. But the configuration breaks on dependency of network-any in GHC 6.6. I thought network-any was part of Hierarchical libraries? If not where do I get it? The generic place for libraries nowadays is hackage:

[Haskell-cafe] RE: Re: Remember the future

2007-08-24 Thread Benjamin Franksen
Simon Peyton-Jones wrote: | It is unfortunate that the [ghc] manual does not give the translation rules, or at | least the translation for the given example. Hmm. OK. I've improved the manual with a URL to the main paper http://citeseer.ist.psu.edu/erk02recursive.html which is highly

[Haskell-cafe] Re: Using Collections: ElemsView and KeysView

2007-08-22 Thread Benjamin Franksen
Jean-Philippe Bernardy wrote: foldr on ElemsView is defined as such: foldr f i (ElemsView c) = foldr (f . snd) i c so, for example: getElementList = toList . ElemViews Ok, thanks, this helps. I had forgot to look at the instances. When I designed this code (some years ago), I didn't

[Haskell-cafe] Using Collections: ElemsView and KeysView

2007-08-19 Thread Benjamin Franksen
Hi I am using collections-0.3 and need to perform some operations on keys resp. values of a map. In the concrete implementations there are functions like 'elems' and 'keys' but there is no such thing in Data.Collections. Instead there are the types 'ElemsView' and 'KeysView' and functions

[Haskell-cafe] Re: Remember the future

2007-08-18 Thread Benjamin Franksen
Andrew Coppin wrote: Surely all this means is that the magical mdo keyword makes the compiler arbitrarily reorder the expression...? It is not magical but simple syntactic sugar. And no, the compiler does not 'arbitrarily reorder' anything, you do the same in any imperative language with

[Haskell-cafe] Re: Syntax for lambda case proposal could be \of

2007-08-15 Thread Benjamin Franksen
Brian Hulley wrote: Stefan O'Rear wrote: On Wed, Aug 15, 2007 at 06:58:40PM +0100, Duncan Coutts wrote: On Wed, 2007-08-15 at 10:50 -0700, Stefan O'Rear wrote: OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we

[Haskell-cafe] Re: Error building takusen with Cabal-1.1.6.2

2007-08-14 Thread Benjamin Franksen
John Dell'Aquila wrote: Setup.hs wants a module that Cabal hides. Am I doing something wrong (newbie :-) or should I try to fall back to Cabal-1.1.6.1? $ ghc --make -o setup Setup.hs Setup.hs:13:7: Could not find module `Distribution.Compat.FilePath': it is hidden (in package

[Haskell-cafe] Re: Explaining monads

2007-08-13 Thread Benjamin Franksen
Brian Brunswick wrote: One thing that I keep seeing people say (not you), is that monads /sequence/ side effects. This is wrong, or at least a limited picture. /All/ of the above structures are about combining compatible things things together in a row. /None/ of them force any particular

[Haskell-cafe] Re: Help with a project design

2007-08-13 Thread Benjamin Franksen
Andrea Rossato wrote: The task this library should do is simple: given an xml object (representing a bibliographic reference), render it with rules stored in a different xml object (the citation style). While I think I can find solutions for this problem - the rendering -, what I find

[Haskell-cafe] Re: Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-13 Thread Benjamin Franksen
Brian Hulley wrote: Brian Hulley wrote: apfelmus wrote: Brian Hulley schrieb: main = do buffer - createBuffer edit1 - createEdit buffer edit2 - createEdit buffer splitter - createSplitter (wrapWidget edit1) (wrapWidget edit2)

[Haskell-cafe] Re: Re: Explaining monads

2007-08-13 Thread Benjamin Franksen
Brandon S. Allbery KF8NH wrote: On Aug 13, 2007, at 16:29 , Benjamin Franksen wrote: Let's take the simplest example: Maybe. The effect in question is the premature abortion of a computation (when Nothing is returned). And of course Maybe sequences these effects, that's what you use

[Haskell-cafe] Re: Re: Explaining monads

2007-08-13 Thread Benjamin Franksen
Derek Elkins wrote: On Mon, 2007-08-13 at 22:29 +0200, Benjamin Franksen wrote: Brian Brunswick wrote: One thing that I keep seeing people say (not you), is that monads /sequence/ side effects. This is wrong, or at least a limited picture. /All/ of the above structures are about

[Haskell-cafe] Re: Re: Re: Language support for imperative code. Was: Re: monad subexpressions

2007-08-13 Thread Benjamin Franksen
Isaac Dupree wrote: Benjamin Franksen wrote: I'd be careful. Introducing a network connection into the equation makes the object (its methods) susceptible to a whole new bunch of failure modes; think indefinite delays, connection loss, network buffer overflow, etc etc. It may be a mistake

[Haskell-cafe] Re: Small question

2007-08-10 Thread Benjamin Franksen
Andrew Coppin wrote: Like that time yesterday, I compiled from program and got a weird message about GHC about ignored trigraphs or something... What the heck is a trigraph?     Everyone's favorite obscure feature of the ANSI C99 preprocessor. Probably you had something like this is

[Haskell-cafe] Re: Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Benjamin Franksen
Hugh Perkins wrote: Now, arguably the fact that we are pattern matching on the receiver at least means we dont do anything with the invalid data sent, but this is not rocket science: the standard technique to ensure decent compile time validation in rpc-type things is to use an interface.

[Haskell-cafe] Re: a regressive view of support for imperative programming in Haskell

2007-08-09 Thread Benjamin Franksen
Donn Cave wrote: (I have a soft spot for O'Haskell, but alas I must be nearly alone on that.) You are /not/ alone :-) I always found it very sad that O'Haskell and also its sucessor Timber (with all the good real-time stuff added) died the 'quick death' of most research languages. Cheers

[Haskell-cafe] Re: a regressive view of support for imperative programming in Haskell

2007-08-09 Thread Benjamin Franksen
David Roundy wrote: Several times since reading the beginning of this discussion I've wished I had the new syntax so I could write something like: do if predicateOnFileContents (- readFile foo) then ... instead of either do contents - readFile foo if predicateOnFileContents

[Haskell-cafe] Re: Re: a regressive view of support for imperative programming in Haskell

2007-08-09 Thread Benjamin Franksen
David Menendez wrote: On 8/9/07, Benjamin Franksen [EMAIL PROTECTED] wrote: Donn Cave wrote: (I have a soft spot for O'Haskell, but alas I must be nearly alone on that.) You are /not/ alone :-) I always found it very sad that O'Haskell and also its sucessor Timber (with all the good real

[Haskell-cafe] Re: Re: a regressive view of support for imperative programming in Haskell

2007-08-09 Thread Benjamin Franksen
David Roundy wrote: On Thu, Aug 09, 2007 at 08:45:14PM +0200, Benjamin Franksen wrote: David Roundy wrote: Several times since reading the beginning of this discussion I've wished I had the new syntax so I could write something like: do if predicateOnFileContents (- readFile foo

[Haskell-cafe] Re: Handling custom types in Takusen

2007-07-27 Thread Benjamin Franksen
Salvatore Insalaco wrote: I noticed that in Takusen there're just two instances to implement to make any Haskell type db-serializable: DBBind / SqliteBind for serialization and DBType for deserialization. FWIW, I have two patches lying around (attached) that I wanted to send to the Takusen

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Benjamin Franksen
apfelmus wrote: Jules Bean wrote: Have you tried using pattern guards for views? f s | y : ys - viewl s = | EmptyL - viewl s = Hm, I'd simply use a plain old case-expression here f s = case viewl s of y : ys - ... EmptyL - ... In other words,

[Haskell-cafe] upgrading Text.Printf

2007-07-25 Thread Benjamin Franksen
Hi, I am using Text.Printf (package base, ghc-6.6.1) and am missing %X formatting. Checking out the darcs repo of the base package I see that it has already been added there. Is there any way to upgrade to the latest version while keeping ghc-6.6.1? I keep hearing Bulat saying that this is not

[Haskell-cafe] Re: Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Benjamin Franksen
Dan Licata wrote: On Jul25, apfelmus wrote: The point is to be able to define both zip and pairs with one and the same operator : . There's actually a quite simple way of doing this. You make the view type polymorphic, but not in the way you did: type Queue elt empty :: Queue

[Haskell-cafe] Re: upgrading Text.Printf

2007-07-25 Thread Benjamin Franksen
Ian Lynagh wrote: On Wed, Jul 25, 2007 at 03:38:50PM +0200, Benjamin Franksen wrote: I am using Text.Printf (package base, ghc-6.6.1) and am missing %X formatting. Checking out the darcs repo of the base package I see that it has already been added there. Is there any way to upgrade

[Haskell-cafe] Re: Help with IO and randomR

2007-07-22 Thread Benjamin Franksen
Niko Korhonen wrote: Bryan Burgers wrote: tpdfs range = do g - newStdGen -- get a random generator (g1, g2) - return $ split g -- make two random generators out of it return $ zipWith combine (randomRs range g1) (randomRs range g2) -- get two streams of random numbers, and combine

[Haskell-cafe] RE: Speedy parsing

2007-07-22 Thread Benjamin Franksen
Re, Joseph (IT) wrote: Ah, I thought I might have to resort to one of the ByteStrings modules. I've heard of them but was more or less avoiding them due to some complexities with installing extra libraries in my current dev environment. I'll try to work that out with the sysadmins and try it

[Haskell-cafe] Re: RE: Speedy parsing

2007-07-22 Thread Benjamin Franksen
Thomas Schilling wrote: On 22 jul 2007, at 23.46, Benjamin Franksen wrote: On a different note: I've been wondering how difficult it would be to re-write Parsec so that it doesn't act on a /list/ of tokens but on a Sequence (defined in Data.Collections from collections package). Because

[Haskell-cafe] A wish for relaxed layout syntax

2007-03-28 Thread Benjamin Franksen
Hi, I often run into the following issue: I want to write a list of lengthy items like this mylist = [ quite_lengthy_list_item_number_one, quite_lengthy_list_item_number_two, quite_lengthy_list_item_number_three ] With the current layout rules this is a parse error (at the closing

[Haskell-cafe] Re: Can we do better than duplicate APIs?

2007-03-28 Thread Benjamin Franksen
Robert Dockins wrote: Some sort of in-langauge or extra-language support for mechanicly producing the source files for the full API from the optimized core API would be quite welcome. Have you considered using DrIFT? IIRC it is more portable and easier to use than TH. Handling export

[Haskell-cafe] Re: Why the Prelude must die

2007-03-28 Thread Benjamin Franksen
mgsloan wrote: On 3/24/07, Vivian McPhail [EMAIL PROTECTED] wrote: I agree with Sven, but... What I want to push is a 'mathematically sound' numeric prelude. A proper numerical prelude should have bona fide mathematical obects like groups, rings, and fields underlying common numerical

[Haskell-cafe] Re: Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

2007-03-26 Thread Benjamin Franksen
Jean-Philippe Bernardy wrote: Please look at http://darcs.haskell.org/packages/collections/doc/html/Data-Collections.html for an effort to make most common operation on bulk types fit in a single framework. The last time I looked at this (shortly after you started the project) I wasn't sure if

[Haskell] Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

2007-03-23 Thread Benjamin Franksen
[sorry for the somewhat longer rant, you may want to skip to the more technical questions at the end of the post] Twan van Laarhoven wrote: I would like to announce version 0.3 of my Data.CompactString library. Data.CompactString is a wrapper around Data.ByteString that represents a Unicode

[Haskell-cafe] Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

2007-03-23 Thread Benjamin Franksen
[sorry for the somewhat longer rant, you may want to skip to the more technical questions at the end of the post] Twan van Laarhoven wrote: I would like to announce version 0.3 of my Data.CompactString library. Data.CompactString is a wrapper around Data.ByteString that represents a Unicode

[Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-21 Thread Benjamin Franksen
Benjamin Franksen wrote: Bertram Felgenhauer wrote: Having to rely on GC to close the fds quickly enough is another problem; can this be solved on the library side, maybe by performing GCs when running out of FDs? Claus Reinke wrote: in good old Hugs, for instance, we find in function

[Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-20 Thread Benjamin Franksen
Bertram Felgenhauer wrote: Having to rely on GC to close the fds quickly enough is another problem; can this be solved on the library side, maybe by performing GCs when running out of FDs? Claus Reinke wrote: in good old Hugs, for instance, we find in function newHandle in src/iomonad.c

[Haskell-cafe] Re: Recursion in Haskell

2007-02-19 Thread Benjamin Franksen
P. R. Stanley wrote: Chaps, is there another general pattern for mylen, head or tail? mylen [] = 0 mylen (x:xs) = 1 + mylen (xs) head [] = error what head? head (x:xs) = x tail [] = error no tail tail (x:xs)= xs There are of course stylistic variations possible, e.g. you can use case

Re: do-and-if-then-else modification

2007-02-18 Thread Benjamin Franksen
isaac jones wrote: Iavor and I just made the trivial modification for DoAndIfThenElse syntax as described here: http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse You can see the change here: http://darcs.haskell.org/haskell-prime-report/report/haskell-report-html/exps.html

[Haskell-cafe] Re: Summarize of Why do I have to specify (Monad m) here again?

2007-02-18 Thread Benjamin Franksen
David Tolpin wrote: On Mon, 19 Feb 2007 02:17:34 +0400, Marc Weber [EMAIL PROTECTED] wrote: Would it make sense to specify partial type declarations ? I don't need an answer right now. no, it wouldn't. I think it would, and it seems there are others. See e.g.

Re: [Haskell-cafe] Newbie Q: GHCi: Where ?List? module is imported from?

2007-02-16 Thread Benjamin Franksen
Jules Bean wrote: Dmitri O.Kondratiev wrote: Set module here is built with list and uses among other things list comparison functions such as (==) and (=). Q1: Where List module is imported from? GHC Base package contains Data.List module, not just List module. List was the old name for

[Haskell-cafe] Suggestion for hackage

2007-02-13 Thread Benjamin Franksen
Hi It would be a nice feature if one could look online at the documentation of a package, i.e. w/o downloading and building the package first. Fr instance, haddock generated API docs can give you a much better idea what you can expect from a library package than the mere package description.

[Haskell-cafe] Re: Implementation of scaled integers

2007-02-13 Thread Benjamin Franksen
Stefan Heinzmann wrote: is there a library for Haskell that implements scaled integers, i.e. integers with a fixed scale factor so that the scale factor does not need to be stored, but is part of the type? I dimly remember that there has been some work done on this in connection with (and by

[Haskell-cafe] Re: Parsec and Java

2007-02-12 Thread Benjamin Franksen
Arnaud Bailly wrote: Joel Reymont wrote: Is there a Java parser implemented using Parsec? There is: http://jparsec.codehaus.org/ Jparsec is an implementation of Haskell Parsec on the Java platform. I think Joel was asking for a parser for the Java language, written in Haskell using the

[Haskell-cafe] Re: State of OOP in Haskell

2007-02-08 Thread Benjamin Franksen
[EMAIL PROTECTED] wrote: Here are two surveys (somewhat outdated) on the use of formal methods in industry: http://citeseer.ifi.unizh.ch/39426.html http://citeseer.ifi.unizh.ch/craigen93international.html Both of these links are dead. Could you post author and title? Thanks Ben

[Haskell-cafe] Re: Re: nested maybes

2007-02-06 Thread Benjamin Franksen
Udo Stenzel wrote: Benjamin Franksen wrote: Udo Stenzel wrote: Sure, you're right, everything flowing in the same direction is usually nicer, and in central Europe, that order is from the left to the right. What a shame that the Haskell gods chose to give the arguments

[Haskell-cafe] Re: nested maybes

2007-02-05 Thread Benjamin Franksen
Udo Stenzel wrote: Sure, you're right, everything flowing in the same direction is usually nicer, and in central Europe, that order is from the left to the right. What a shame that the Haskell gods chose to give the arguments to (.) and ($) the wrong order! But then application is in the

Re: [Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-02-01 Thread Benjamin Franksen
[sorry, this was meant to go to the list] On Wednesday 31 January 2007 00:40, Bulat Ziganshin wrote: Saturday, January 27, 2007, 12:00:11 AM, you wrote: and support operational reasoning, i.e. creating and understanding programs by mentally modeling their execution on a machine. This form

[Haskell-cafe] Re: Re[2]: Channel9 Interview: Software Composability and the Future of Languages

2007-01-31 Thread Benjamin Franksen
Bulat Ziganshin wrote: 2. it bites me too. it's why i say that C++ is better imperative language than Haskell. there are also many other similar issues, such as lack of good syntax for for, while, break and other well-known statements, inability to use return inside of block and so on You

Re: help from the community?

2007-01-30 Thread Benjamin Franksen
Andres Loeh wrote: I cannot see how an empty list of tyvars is useful or desirable in practice: data Foo = Foo (forall . Int) is equivalent to just data Foo = Foo Int so why bother to permit the former? It probably indicates some error in the thinking of the programmer, so the

[Haskell-cafe] Re: State of OOP in Haskell

2007-01-30 Thread Benjamin Franksen
Yitzchak Gale wrote: Steve Downey wrote: OO, at least when done well, maps well to how people think. Um, better duck. I am afraid you are about to draw some flames on that one. I hope people will try to be gentle. No problem ;-) I'll never get tired quoting Dijkstra; one of the things

[Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-28 Thread Benjamin Franksen
Chris Kuklewicz wrote: Note that I have not mentioned laziness.  This is because it only helps to solve problems more elegantly -- other languages can model infinite computations / data structures when it is useful to do so. Reminds me of yet another quote from Dijkstra

[Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-28 Thread Benjamin Franksen
Chris Kuklewicz wrote: Aside on utterly useful proofs: When you write concurrent programs you want an API with strong and useful guarantees so you can avoid deadlocks and starvation and conflicting data read/writes.  Designing an using such an API is a reasoning exercise identical to creating

[Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-26 Thread Benjamin Franksen
Steve Schafer wrote: Neil Bartlett wrote: It also highlights some of the misconceptions that still exist and need to be challenged, e.g. the idea that Haskell is too hard or is impractical for real work. Haskell _is_ hard, although I don't think it's _too_ hard, or I wouldn't be here,

[Haskell] Re: Even higher-order abstract syntax: typeclasses vs GADT

2007-01-22 Thread Benjamin Franksen
[EMAIL PROTECTED] wrote: We show the typeclass implementation of the example used to make the case for GADTs. We demonstrate the higher-order abstract-syntax-based embedding of a language in Haskell and implement static and dynamic semantics of the language. The interpreter of the language is

[Haskell] Re: Views in Haskell

2007-01-22 Thread Benjamin Franksen
David Roundy wrote: Another idea is whether the syntax could be extended to indicate a failure to match? This would actually be useful even without views, but it's particularly useful with views (and especially so in the context of the above warnings). I'd imagine something like (with

[Haskell] Re: Re: Even higher-order abstract syntax: typeclasses vs GADT

2007-01-22 Thread Benjamin Franksen
Tomasz Zielonka wrote: On Mon, Jan 22, 2007 at 11:34:32PM +0100, Benjamin Franksen wrote: I would be interested whether you can not only /check/ well-typedness, but also /establish/ it, i.e. is it possible to have the input to the type-checker be an /untyped/ representation (such as obtained

[Haskell-cafe] Re: GHC concurrency runtime breaks every 497 (and a bit) days

2007-01-22 Thread Benjamin Franksen
Neil Davies wrote: In investigating ways of getting less jitter in the GHC concurrency runtime I've found the following issue: The GHC concurrency model does all of its time calculations in ticks - a tick being fixed at 1/50th of a second. It performs all of these calculations in terms the

[Haskell-cafe] Re: Partial Application

2007-01-18 Thread Benjamin Franksen
Philippe de Rochambeau wrote: my original query concerning partial application was triggered by the following statement from Thomson's The Craft of Functional Programming, p. 185: multiplyUC :: (Int, Int) - Int multiplyUC (x,y) = x * y multiply :: Int - Int - Int multiply x y = x * y

Re: [Haskell-cafe] Re: Monad Set via GADT

2007-01-12 Thread Benjamin Franksen
On Friday 12 January 2007 09:04, Simon Peyton-Jones wrote: | On 1/3/07, Roberto Zunino [EMAIL PROTECTED] wrote: | 1) Why the first version did not typececk? | | 1) Class constraints can't be used on pattern matching. They ARE | restrictive on construction, however. This is arguably bug

[Haskell-cafe] Re: Monad Set via GADT

2007-01-11 Thread Benjamin Franksen
Jim Apple wrote: On 1/3/07, Roberto Zunino [EMAIL PROTECTED] wrote: 1) Why the first version did not typececk? 1) Class constraints can't be used on pattern matching. They ARE restrictive on construction, however. This is arguably bug in the Haskell standard. It is fixed in GHC HEAD for

[Haskell-cafe] Re: Re: Large data structures

2006-12-13 Thread Benjamin Franksen,15.8.202,6392-4982,
Alex Queiroz wrote: On 12/12/06, Benjamin Franksen [EMAIL PROTECTED] wrote: PS: Please try to include exactly the relevant context in replies, no more, no less. Your original question (stripped down to the body of the text) would have been relevant, here, but neither 'Hello', nor 'Cheers

[Haskell-cafe] What is a hacker? [was: Mozart versus Beethoven]

2006-12-13 Thread Benjamin Franksen
Kirsten Chevalier wrote: On 12/12/06, Patrick Mulder [EMAIL PROTECTED] wrote: PS I like the idea of a book Hakell for Hackers Maybe Haskell for People Who Want to Be Hackers? I would never buy a book with such a title, even if I didn't have the slightest clue about programming. However

[Haskell-cafe] Re: Why so slow?

2006-12-11 Thread Benjamin Franksen
Lyle Kopnicky wrote: The code below is using way more RAM than it should. It seems to only take so long when I build the 'programs' list - the actual reading/parsing is fast. For a 5MB input file, it's using 50MB of RAM! Any idea how to combat this? 1) I strongly recommend to work through at

[Haskell-cafe] Re: Aim Of Haskell

2006-12-11 Thread Benjamin Franksen
Joachim Durchholz wrote: These activities are among the major reasons why I'm finally prepared to get my feet wet with Haskell after years of interested watching. I'll probably fire off a set of newbie questions for my project, though it might still take a few days to get them organized well

[Haskell-cafe] Re: Writing Haskell For Dummies Or At Least For People Who Feel Like Dummies When They See The Word 'Monad'

2006-12-11 Thread Benjamin Franksen
Sebastian Sylvan wrote: Perhaps a single largish application could be the end product of the book. Like a game or something. You'd start off with some examples early on, and then as quickly as possible start working on the low level utility functions for the game, moving on to more and more

[Haskell-cafe] Re: Large data structures

2006-12-11 Thread Benjamin Franksen
Alex Queiroz wrote: On 12/11/06, Stefan O'Rear [EMAIL PROTECTED] wrote: No. Haskell's lists are linked lists, enlarge creates a single new link without modifying (and copying) the original. Thanks. Is there a way to mimic this behaviour with my own code? It is the default for any data

Re: [Haskell-cafe] Re: Beginner: IORef constructor?

2006-12-06 Thread Benjamin Franksen
On Wednesday 06 December 2006 07:40, Bernie Pope wrote: On 05/12/2006, at 1:00 PM, Benjamin Franksen wrote: Bernie Pope wrote: If you want a global variable then you can use something like: import System.IO.Unsafe (unsafePerformIO) global = unsafePerformIO (newIORef

[Haskell-cafe] Re: Typeclass question

2006-12-06 Thread Benjamin Franksen
Stefan O'Rear wrote: [...] Unfortunately, it turns out that allowing foralls inside function arguments makes typechecking much harder, in general impossible. Just a tiny correction: AFAIK, it is type /inference/ which becomes undecidable in the presence of higher rank types -- checking works

[Haskell-cafe] Re: Beginner: IORef constructor?

2006-12-04 Thread Benjamin Franksen
Bernie Pope wrote: If you want a global variable then you can use something like: import System.IO.Unsafe (unsafePerformIO) global = unsafePerformIO (newIORef []) But this is often regarded as bad programming style (depends who you talk to). Besides, isn't this example

Teaching (was: defaults)

2006-11-30 Thread Benjamin Franksen
Malcolm Wallace wrote: Unfortunately, I suspect that teaching is _the_ major use-case for defaulting. Imagine, day one, lesson one, a student types Prelude 1+2 into Hugs, and gets the response Unresolved overloading: Num a Huh? This is lesson one, and you already need to

[Haskell-cafe] Re: Re: The Future of MissingH

2006-11-27 Thread Benjamin Franksen
Bulat Ziganshin wrote: Monday, November 27, 2006, 1:46:34 AM, you wrote: I hate to be nitpicking but GPL is not only compatible with but encourages commerce in general and commercial software in particular. It is incompatible with proprietary software. There's a difference. of course, but

[Haskell-cafe] RE: why are implicit types different? (cleanup)

2006-11-27 Thread Benjamin Franksen
S. Alexander Jacobson wrote: Ok, I'm not sure I understand the answer here, but how about a workaround. My current code looks like this: tt = let ?withPassNet=wpn ?withPassNet'=wpn ?withPassNet''=wpn in passNet passnet [user] regImpl b The type of

[Haskell] Re: Announcement: cabal-test

2006-11-26 Thread Benjamin Franksen
Lemmih wrote: It's my great pleasure to announce cabal-test, the automatic tester for Cabal projects. [...] http://darcs.haskell.org/~lemmih/cabal-test What about changing #!/usr/bin/env runhugs to #!/usr/bin/env runhaskell in your Setup.lhs? Cheers Ben

[Haskell-cafe] Re: The Future of MissingH

2006-11-26 Thread Benjamin Franksen
Bulat Ziganshin wrote: Friday, November 24, 2006, 7:32:55 PM, you wrote: Josef Svenningsson posted a comment on my blog today that got me to thinking. He suggested that people may be intimidated by the size of MissingH, confused by the undescriptive name, and don't quite know what's in

[Haskell-cafe] Re: Priority Queue?

2006-11-26 Thread Benjamin Franksen
Ken Takusagawa wrote: Is there a Haskell implementation of an efficient priority queue (probably heap-based) out there that I can use? I do not see it in the GHC libraries. Unfortunately the base package contains only the specialized Data.Sequence and not the general annotated 2-3 finger

[Haskell] Re: [Haskell-cafe] SimonPJ and Tim Harris explain STM - video

2006-11-23 Thread Benjamin Franksen
[sorry for quoting so much, kinda hard to decide here where to snip] Cale Gibbard wrote: On 23/11/06, Jason Dagit [EMAIL PROTECTED] wrote: A comment on that video said: - BEGIN QUOTE It seems to me that STM creates new problems with composability. You create two classes of code:

[Haskell-cafe] Re: list monad and controlling the backtracking

2006-11-23 Thread Benjamin Franksen
isto wrote: Hi all, Weekly news had a link to article Local and global side effects with monad transformers and the following is from there (minor modification done): import Control.Monad.List import Control.Monad.State import Control.Monad.Writer test5 :: StateT Integer (ListT

[Haskell-cafe] Re: Equivalent of if/then/else for IO Bool?

2006-11-23 Thread Benjamin Franksen
Dougal Stanton wrote: Is there some sort of equivalent of the if/then/else construct for use in the IO monad? For instance the following can get quite tedious: do bool - doesFileExist filename if bool then sth else sth' Is there a more compact way of writing that? Something

Re: [Haskell-cafe] SimonPJ and Tim Harris explain STM - video

2006-11-23 Thread Benjamin Franksen
[sorry for quoting so much, kinda hard to decide here where to snip] Cale Gibbard wrote: On 23/11/06, Jason Dagit [EMAIL PROTECTED] wrote: A comment on that video said: - BEGIN QUOTE It seems to me that STM creates new problems with composability. You create two classes of code:

[Haskell-cafe] Re: [Haskell] Re: SimonPJ and Tim Harris explain STM - video

2006-11-23 Thread Benjamin Franksen
Hi Liyang HU you wrote: On 23/11/06, Benjamin Franksen [EMAIL PROTECTED] wrote: One answer is in fact to make it so that Console.Write can be rolled back too. To achieve this one can factor the actual output to another task and inside the transaction merely send the message

[Haskell-cafe] Re: jhc, whole program optimizing compiler.

2006-11-19 Thread Benjamin Franksen
[EMAIL PROTECTED] wrote: Do anyone had any experience with JHC? I tried to install it second time and again get an error during library build. It's a pity, we need a speed in our very lazy code. ;) I had the same problem and asked John. He explained why and told me how to proceed: that

[Haskell-cafe] Re: Re: Debugging partial functions by the rules

2006-11-18 Thread Benjamin Franksen
Daniel, you wrote: I suspect I would be classified as a newbie relative to most posters on this list but here's my thoughts anyway... [...] One of my initial responses to haskell was disappointment upon seeing head, fromJust and the like. 'Those look nasty', I sez to meself. From day one

[Haskell-cafe] Re: Re: Debugging partial functions by the rules

2006-11-15 Thread Benjamin Franksen
John Hughes wrote: From: Robert Dockins [EMAIL PROTECTED] It seems to me that every possible use of a partial function has some (possibly imagined) program invariant that prevents it from failing. Otherwise it is downright wrong. 'head', 'fromJust' and friends don't do anything to put that

[Haskell-cafe] Re: Re: non-total operator precedence order (was:Fractional/negative fixity?)

2006-11-10 Thread Benjamin Franksen
Henning Thielemann wrote: On Fri, 10 Nov 2006, Benjamin Franksen wrote: Although one could view this as a bug in the offending module it makes me somewhat uneasy that one additional import can have such a drastic effect on the code in a module /even if you don't use anything from that module

  1   2   3   4   >