Re: [Haskell-cafe] System.Process.Posix

2009-04-07 Thread Jonathan Cast
On Tue, 2009-04-07 at 14:31 +0100, Neil Mitchell wrote: Hi Is it me or the above package is not included in Hoogle? afair, Neil, being windows user, includes only packages available for his own system there was a large thread a few months ago and many peoples voted for excluding

Re: [Haskell-cafe] Missing dependency?

2009-04-02 Thread Jonathan Cast
On Thu, 2009-04-02 at 16:13 -0700, Lyle Kopnicky wrote: Hi folks, Since the time package is not included in ghc-6.10.2, I installed it via cabal. Then I tried to configure my project, and it says that the dependency is missing. Mysterious. Can anyone explain?

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-30 Thread Jonathan Cast
On Fri, 2009-03-27 at 21:16 -0700, Donn Cave wrote: Quoth Henning Thielemann lemm...@henning-thielemann.de, On Fri, 27 Mar 2009, Donn Cave wrote: Quoth Jonathan Cast jonathancc...@fastmail.fm, An `error' is any condition where the correct response is for the programmer to change

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-30 Thread Jonathan Cast
On Sat, 2009-03-28 at 01:27 +0100, Henning Thielemann wrote: Jonathan Cast schrieb: i.e., that application's file decoding result should be an Either type that anticipates that the file encoding may be invalid. This is pretty standard, I thought. Do people write Haskell file input

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-29 Thread Jonathan Cast
On Sat, 2009-03-28 at 12:51 +0300, Gregory Petrosyan wrote: On Sat, Mar 28, 2009 at 10:53 AM, Ketil Malde ke...@malde.org wrote: So the difference between an exception or an error type is mainly what you intend to do about it. There's no point in wrapping divisions in Maybe unless you

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread Jonathan Cast
On Fri, 2009-03-27 at 12:24 +, Chris Kuklewicz wrote: Jonathan Cast wrote: Sure. Which also points out that the original safeDiv wasn't actually safe, since there's no guarantee of what evaluate will do with x and y. (Actually, there's not much guarantee of what evaluate does anyway

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread Jonathan Cast
On Fri, 2009-03-27 at 09:31 -0700, Donn Cave wrote: Quoth John Lato jwl...@gmail.com, An exception is caused by some sort of interaction with the run-time system (frequently a hardware issue). The programmer typically can't check for these in advance, but can only attempt to recover

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread Jonathan Cast
On Fri, 2009-03-27 at 20:38 +0300, Gregory Petrosyan wrote: On Fri, Mar 27, 2009 at 7:31 PM, Donn Cave d...@avvanta.com wrote: Quoth John Lato jwl...@gmail.com, An exception is caused by some sort of interaction with the run-time system (frequently a hardware issue). The programmer

Re: [Haskell-cafe] Re: A bit of a shock - Memoizing functions

2009-03-27 Thread Jonathan Cast
On Fri, 2009-03-27 at 14:26 -0700, Kirk Martinez wrote: Your powersOfTwo function, since it gets memoized automatically (is this the case for all functions of zero arguments?), It is the case for all functions which have zero arguments *at the time they are presented to the code generator*.

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread Jonathan Cast
On Thu, 2009-03-26 at 14:23 -0400, Xiao-Yong Jin wrote: Henning Thielemann lemm...@henning-thielemann.de writes: On Thu, 26 Mar 2009, Xiao-Yong Jin wrote: So I have another question. Is the following function safe and legitimate? safeDiv :: (Exception e, Integral a) =

Re: mapM as a Space Leak (Was: [Haskell-cafe] about Haskell code written to be too smart)

2009-03-26 Thread Jonathan Cast
On Thu, 2009-03-26 at 12:29 -0700, Thomas Hartman wrote: I wonder if JHC or some other compiler might work better with these examples? Are you saying that different compilers might give different answers? Yikes! Too clever indeed! No, they might produce code with different

Re: [Haskell-cafe] an OS-independent executeFile??

2009-03-26 Thread Jonathan Cast
On Thu, 2009-03-26 at 17:16 -0500, Vasili I. Galchin wrote: Hello, I have been looking through Hackage and using Hoogle to fork and execute a program in an OS-independent way, i.e. neutral from POSIX and Win32 APIs. Does such a library function exist? System.Process.createProcess (

Re: [Haskell-cafe] an OS-independent executeFile??

2009-03-26 Thread Jonathan Cast
On Thu, 2009-03-26 at 17:27 -0500, Vasili I. Galchin wrote: ok .. how about API independent? ;^) Last I checked VMS, OS/360 (NB: not dead by a long shot), etc. had APIs too. What you really mean is `does not break when run against Windows's pseudo-POSIX API despite Microsoft's best efforts' :)

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread Jonathan Cast
On Thu, 2009-03-26 at 21:57 -0400, wren ng thornton wrote: Jonathan Cast wrote: Xiao-Yong Jin wrote: Xiao-Yong Jin wrote: So I have another question. Is the following function safe and legitimate? safeDiv :: (Exception e, Integral a) = a - a - Either e

Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?

2009-03-25 Thread Jonathan Cast
On Tue, 2009-03-24 at 23:13 -0700, Donn Cave wrote: Quoth Duncan Coutts duncan.cou...@worc.ox.ac.uk: You must not do this. It breaks the semantics of the language. Other people have given practical reasons why you should not but a theoretical reason is that you've defined a

Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 07:39 -0400, Xiao-Yong Jin wrote: Jonathan Cast jonathancc...@fastmail.fm writes: On Tue, 2009-03-24 at 23:13 -0700, Donn Cave wrote: Quoth Duncan Coutts duncan.cou...@worc.ox.ac.uk: You must not do this. It breaks the semantics of the language. Other

Re: [Haskell-cafe] Re: about Haskell code written to be too smart

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 15:09 +, Simon Marlow wrote: the ordering that the state monad expects (and I can never remember which way around they are in Control.Monad.State). Really? I found it obvious once I figured out it how simple it made (=). With the order from Control.Monad.State (with

Re: [Haskell-cafe] Re: about Haskell code written to be too smart

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 03:01 +, Robin Green wrote: On Wed, 25 Mar 2009 08:25:40 -0700 Jonathan Cast jonathancc...@fastmail.fm wrote: Define swap (a, b) = (b, a) By the way, if you want to be too smart, there's a generalised version of swap in Control.Category.Braided

Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 09:15 -0700, Donn Cave wrote: Quoth Lennart Augustsson lenn...@augustsson.net: Some examples of what might happen: OK, these are interesting phenomena. From a practical point of view, though, I could see someone weighing the potential costs and benefits of a

Re: [Haskell-cafe] Re: about Haskell code written to be too smart

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 15:32 +, Simon Marlow wrote: Jonathan Cast wrote: On Wed, 2009-03-25 at 15:09 +, Simon Marlow wrote: the ordering that the state monad expects (and I can never remember which way around they are in Control.Monad.State). Really? I found it obvious once

Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 10:00 -0700, Donn Cave wrote: Quoth Jonathan Cast jonathancc...@fastmail.fm: On Wed, 2009-03-25 at 09:15 -0700, Donn Cave wrote: OK, these are interesting phenomena. From a practical point of view, though, I could see someone weighing the potential costs

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 12:48 -0700, Dan Weston wrote: However, there is something to be said for code that just looks like a duck and quacks like a duck. It's less likely to surprise you. So... I insist... Easy for a beginner to read == better! All you have said is that one building a

Re: [Haskell-cafe] [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 21:18 +, Andrew Coppin wrote: I'M ON WINDOWS! ;-) We've noticed... jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?

2009-03-25 Thread Jonathan Cast
On Wed, 2009-03-25 at 22:32 +0100, Henning Thielemann wrote: On Wed, 25 Mar 2009, Jonathan Cast wrote: On Wed, 2009-03-25 at 07:39 -0400, Xiao-Yong Jin wrote: Could you elaborate more about why this kind of breakage wouldn't happen if 'try' is used in an IO monad as intended

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jonathan Cast
On Tue, 2009-03-24 at 19:42 +0100, Manlio Perillo wrote: Tim Newsham ha scritto: These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is that when they start reading some code, they feel the Perl syndrome. That

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jonathan Cast
On Tue, 2009-03-24 at 22:33 +0300, Eugene Kirpichov wrote: Pretty cool once you know what the function does, but I must admit I wouldn't immediately guess the purpose of the function when written in this way. I wouldn't immediately guess the purpose of the function written in any way. I

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jonathan Cast
On Tue, 2009-03-24 at 22:43 +0100, Manlio Perillo wrote: Jonathan Cast ha scritto: [...] I think, in general, the best way to document the purpose of the function is -- | Split a function into a sequence of partitions of specified lenth takeList :: [Int

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jonathan Cast
On Tue, 2009-03-24 at 23:15 +0100, Manlio Perillo wrote: Dan Piponi ha scritto: Miguel Mitrofanov wrote: takeList = evalState . mapM (State . splitAt) However, ironically, I stopped using them for pretty much the same reason that Manlio is saying. Are you saying there's a problem

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jonathan Cast
On Tue, 2009-03-24 at 16:43 -0700, Donn Cave wrote: If he really intended to promote some dumb code as a better alternative to some otherwise equivalent smart code, `Smart' is Manlio's term --- or, rather, his characterization of his friends' reaction upon seeing some inscrutable piece of

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-18 Thread Jonathan Cast
On Tue, 2009-03-17 at 12:59 +0100, Ketil Malde wrote: Duncan Coutts duncan.cou...@worc.ox.ac.uk writes: [..] I have a sneaking suspicion [exceptions] actually *is* `unsafe'. Or, at least, incapable of being given a compositional, continuous semantics. Basically if we can only catch

Re: categories and monoids (was: Re: [Haskell-cafe] Design Patterns by Gamma or equivalent)

2009-03-17 Thread Jonathan Cast
On Tue, 2009-03-17 at 13:06 +0100, Wolfgang Jeltsch wrote: Am Dienstag, 17. März 2009 10:54 schrieben Sie: Wolfgang Jeltsch g9ks1...@acme.softbase.org writes: By the way, the documentation of Control.Category says that a category is a monoid (as far as I remember). This is wrong. Category

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-17 Thread Jonathan Cast
On Tue, 2009-03-17 at 12:40 +, Claus Reinke wrote: So that first step already relies on IO (where the two are equivalent). Come again? The first step in your implication chain was (without the return) throw (ErrorCall urk!) = 1 == evaluate (throw (ErrorCall urk!)) = evaluate

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-16 Thread Jonathan Cast
On Mon, 2009-03-16 at 22:12 +0100, Henning Thielemann wrote: On Sun, 15 Mar 2009, Claus Reinke wrote: import Data.IORef import Control.Exception main = do r - newIORef 0 let v = undefined handle (\(ErrorCall _)-print hireturn 42) $ case f v of 0 - return 0 n -

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-16 Thread Jonathan Cast
On Mon, 2009-03-16 at 22:01 +, Duncan Coutts wrote: On Mon, 2009-03-16 at 14:17 -0700, Jonathan Cast wrote: On Mon, 2009-03-16 at 22:12 +0100, Henning Thielemann wrote: On Sun, 15 Mar 2009, Claus Reinke wrote: import Data.IORef import Control.Exception main = do

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-16 Thread Jonathan Cast
On Tue, 2009-03-17 at 01:16 +, Claus Reinke wrote: exception handling which allows to catch programming errors. And which I have a sneaking suspicion actually *is* `unsafe'. Or, at least, incapable of being given a compositional, continuous semantics. A semantics for imprecise

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Jonathan Cast
On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote: unsafeInterleaveIO allows embedding side effects into a pure computation. This means you can potentially observe if some pure value has been evaluated or not; the result of your code could change depending how lazy/strict it is, which is

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Jonathan Cast
On Sun, 2009-03-15 at 21:43 +0100, Daniel Fischer wrote: Am Sonntag, 15. März 2009 21:25 schrieb Jonathan Cast: On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote: Furthermore, due to the monad laws, if f is total, then reordering the (x - ...) and (y - ...) parts of the program

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Jonathan Cast
On Sun, 2009-03-15 at 22:09 +0100, Daniel Fischer wrote: Am Sonntag, 15. März 2009 21:56 schrieb Jonathan Cast: On Sun, 2009-03-15 at 21:43 +0100, Daniel Fischer wrote: Am Sonntag, 15. März 2009 21:25 schrieb Jonathan Cast: On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Jonathan Cast
On Sun, 2009-03-15 at 23:18 +0100, Daniel Fischer wrote: Am Sonntag, 15. März 2009 22:20 schrieb Jonathan Cast: There is *no* guarantee that main0 prints 0, while main1 prints 1, as claimed. The compiler is in fact free to produce either output given either program, at its option. Since

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Jonathan Cast
On Mon, 2009-03-16 at 00:14 +0100, Daniel Fischer wrote: Am Sonntag, 15. März 2009 23:30 schrieb Jonathan Cast: On Sun, 2009-03-15 at 23:18 +0100, Daniel Fischer wrote: Am Sonntag, 15. März 2009 22:20 schrieb Jonathan Cast: There is *no* guarantee that main0 prints 0, while main1 prints

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Jonathan Cast
On Mon, 2009-03-16 at 01:04 +0100, Daniel Fischer wrote: Am Montag, 16. März 2009 00:47 schrieb Jonathan Cast: On Mon, 2009-03-16 at 00:14 +0100, Daniel Fischer wrote: However, I understand unsafeInterleaveIO allows IO computation to be deferred lazily. When passed a value

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Jonathan Cast
On Sun, 2009-03-15 at 18:11 -0700, Ryan Ingram wrote: On Sun, Mar 15, 2009 at 1:56 PM, Jonathan Cast jonathancc...@fastmail.fm wrote: But not if you switch the (x - ...) and (y - ...) parts: main = do r - newIORef 0 v - unsafeInterleaveIO $ do writeIORef r 1

Re: [Haskell-cafe] Pointless functors

2009-03-13 Thread Jonathan Cast
On Sat, 2009-03-14 at 02:12 +1000, Matthew Brecknell wrote: Ross Paterson wrote: No. Choose an arbitrary element shape :: f () and define point x = fmap (const x) shape Interesting. Is the arbitrariness of the shape some sort of evidence that Pointed is not really a very useful

Re: [Haskell-cafe] Parsing floating point numbers

2009-03-08 Thread Jonathan Cast
On Sun, 2009-03-08 at 19:34 -0500, Bjorn Buckwalter wrote: Hi all, What is your preferred method of parsing floating point numbers (from String to Float/Double)? Parsec it seems only does positive floats out of the box and PolyParse requires the float to be on scientific form (exponential).

Re: [Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Jonathan Cast
On Thu, 2009-03-05 at 13:08 +, Simon Marlow wrote: Lennart Augustsson wrote: I don't see any breaking of referential transparence in your code. Every time you do an IO operation the result is basically non-deterministic since you are talking to the outside world. You're assuming the

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Jonathan Cast
On Thu, 2009-03-05 at 15:36 -0800, Daryoush Mehrtash wrote: In this chat server implementation http://www.haskell.org/haskellwiki/Implement_a_chat_server forkIO is used with fix as in: reader - forkIO $ fix $ \loop - do (nr', line) - readChan chan' when (nr /= nr') $

Re: [Haskell-cafe] Theory about uncurried functions

2009-03-03 Thread Jonathan Cast
On Wed, 2009-03-04 at 01:35 +0100, Henning Thielemann wrote: On Tue, 3 Mar 2009, Peter Verswyvelen wrote: Now, does a similar theory exist of functions that always have one input and one output, but these inputs and outputs are *always* tuples? Or maybe this does not make any sense? I

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-26 Thread Jonathan Cast
On Thu, 2009-02-26 at 13:52 +0100, Daniel Fischer wrote: Am Donnerstag, 26. Februar 2009 13:41 schrieb John Lato: I didn't phrase this well. In the context of my argument, design for cross-platform meant avoid platform-limiting choices in the absence of any compelling reasons otherwise,

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-26 Thread Jonathan Cast
On Thu, 2009-02-26 at 06:30 -0700, John A. De Goes wrote: On Feb 25, 2009, at 7:49 PM, Achim Schneider wrote: John A. De Goes j...@n-brain.net wrote: The problem is that PL research is probably not going to stop evolving in our lifetimes. Yes, that research needs a venue, but why should

Re: [Haskell-cafe] Re: statep haskell-lang [was: Re: Hoogle and Network.Socket]

2009-02-26 Thread Jonathan Cast
On Thu, 2009-02-26 at 13:18 -0700, John A. De Goes wrote: Are you saying has been no progress since KR C in the number of libraries available to C programmers? And that C programmers still have to edit files with vi and compile and link by specifying all files on the command-line? You

Re: [Haskell-cafe] Re: statep haskell-lang [was: Re: Hoogle and Network.Socket]

2009-02-26 Thread Jonathan Cast
On Thu, 2009-02-26 at 13:25 -0700, John A. De Goes wrote: No, I hate C and will never use it again in my entire life unless forced to at the point of a gun. Why? Its libraries are far better, its editors are far better [1], its compilers are far better, its tool support is far better, it's

Re: [Haskell-cafe] Coming up with a better API for Network.Socket.recv

2009-02-26 Thread Jonathan Cast
On Thu, 2009-02-26 at 22:45 +0100, Johan Tibell wrote: Hi all, I find it quite inconvenient to use the `recv` function in Network.Socket as it throws an exception when reaching EOF and there's no way to check whether EOF has been reached before calling `recv`. This means that all calls to

Re: [Haskell-cafe] Re: statep haskell-lang [was: Re: Hoogle and Network.Socket]

2009-02-26 Thread Jonathan Cast
On Thu, 2009-02-26 at 15:23 -0700, John A. De Goes wrote: On Feb 26, 2009, at 1:36 PM, Jonathan Cast wrote: On Thu, 2009-02-26 at 13:25 -0700, John A. De Goes wrote: No, I hate C and will never use it again in my entire life unless forced to at the point of a gun. Why? Its libraries

Re: [Haskell-cafe] Re: statep haskell-lang [was: Re: Hoogle and Network.Socket]

2009-02-26 Thread Jonathan Cast
On Fri, 2009-02-27 at 00:04 +0100, Achim Schneider wrote: Jonathan Cast jonathancc...@fastmail.fm wrote: (I am actually writing my own language; when I get something usable for real work, I may very well just plain un-subscribe from haskell-cafe, even though I will continue using Haskell

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread Jonathan Cast
On Wed, 2009-02-25 at 10:23 +, John Lato wrote: 4. Cross-platform concerns are something that responsible developers need to consider, just like localization and i18n. I.e., why *shouldn't* you think of that? Sorry, wtf? I have a *responsibility* to design software for a miserably

Re: [Haskell-cafe] forall ST monad

2009-02-25 Thread Jonathan Cast
On Wed, 2009-02-25 at 10:18 -0800, Kim-Ee Yeoh wrote: Heinrich Apfelmus wrote: Now, (forall a. T[a]) - S is clearly true while exists a. (T[a] - S) should be nonsense: having one example of a marble that is either red or blue does in no way imply that all of

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread Jonathan Cast
On Wed, 2009-02-25 at 17:54 -0700, John A. De Goes wrote: It's a chicken-egg thing. A Linux or OS X developer tries Haskell and finds he can write useful programs right away, with a minimum of fuss. But a Windows user tries Haskell and finds he has access to very few of the really good

Re: [Haskell-cafe] Hoogle and Network.Socket

2009-02-21 Thread Jonathan Cast
On Sat, 2009-02-21 at 07:25 -0700, John A. De Goes wrote: I think the (valid) concern is that too many people are choosing platform-specific packages when there are alternatives available (albeit not as convenient in some cases), and this really hurts the Windows community because

Re: [Haskell-cafe] Hoogle and Network.Socket

2009-02-20 Thread Jonathan Cast
On Fri, 2009-02-20 at 09:17 +, Neil Mitchell wrote: Hi 1) Show all the functions (when the number is low), but place platform specific functions under separate headers: Windows, Linux/BSD/POSIX, OS X, etc. If a function isn't available on all OS's then all Hoogle would be

Re: [Haskell-cafe] equational reasoning

2009-02-19 Thread Jonathan Cast
On Thu, 2009-02-19 at 23:06 +0200, Roman Cheplyaka wrote: * Wouter Swierstra w...@cs.nott.ac.uk [2009-02-19 11:58:38+0100] There are several problems with this approach. For example, I can show: const 0 (head []) = 0 But if I pretend that I don't know that Haskell is lazy: const

Re: [Haskell-cafe] what is [::]

2009-02-18 Thread Jonathan Cast
On Wed, 2009-02-18 at 16:28 +0100, Daniel van den Eijkel wrote: Dear Haskellers, please can anybody tell me what [::] means or where to read about it? A few days ago I saw this for the first time in my life, at the list of instances of the Functor class, and I don't know where to look for

Re: [Haskell-cafe] forall ST monad

2009-02-16 Thread Jonathan Cast
On Mon, 2009-02-16 at 19:36 +0100, Wolfgang Jeltsch wrote: Am Montag, 16. Februar 2009 19:22 schrieb Wolfgang Jeltsch: Am Montag, 16. Februar 2009 19:04 schrieb Kim-Ee Yeoh: Despite its rank-2 type, runST really doesn't have anything to do with existential quantification. First, I

Re: [Haskell-cafe] Re: Haddock Markup

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 11:08 +0100, Heinrich Apfelmus wrote: Jonathan Cast wrote: NB: This example is *precisely* why I will never adopt MathML as an authoring format. Bowing and scraping at the alter of W3C is not worth using such a terrible syntax, not ever. (Indented, that's

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 11:12 -0700, John A. De Goes wrote: I come from a mathematical background (in which it is quite common to overload function names and operators in particular) Usually `when no ambiguity can arise', no? Plenty of mathematical practice rests on imprecision and the

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 11:29 -0700, John A. De Goes wrote: On Feb 13, 2009, at 11:23 AM, Jonathan Cast wrote: Usually `when no ambiguity can arise', no? Plenty of mathematical practice rests on imprecision and the expectation that the human reader will understand what you mean. Haskell

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 11:45 -0700, John A. De Goes wrote: On Feb 13, 2009, at 11:32 AM, Jonathan Cast wrote: I believe the last time it was brought up, the proposal was that type inference should fail on certain typeable terms. That doesn't count. I'm referring to a rather conservative

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 20:06 +0100, Daniel Fischer wrote: Am Freitag, 13. Februar 2009 19:49 schrieb Jonathan Cast: On Fri, 2009-02-13 at 11:45 -0700, John A. De Goes wrote: On Feb 13, 2009, at 11:32 AM, Jonathan Cast wrote: I believe the last time it was brought up, the proposal

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 12:06 -0700, John A. De Goes wrote: On Feb 13, 2009, at 11:49 AM, Jonathan Cast wrote: It breaks type inference. I explained this at the time. I can explain it again: import Data.List import Data.Set import Data.Map warmFuzzyThingFirstOperation

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 12:15 -0700, John A. De Goes wrote: On Feb 13, 2009, at 12:07 PM, Jonathan Cast wrote: Exactly! But if it fails, why on earth should any other use of map in the module succeed? Because more information is known about other usages of map. Such is the nature of type

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-13 Thread Jonathan Cast
On Fri, 2009-02-13 at 21:57 +0100, Daniel Fischer wrote: Am Freitag, 13. Februar 2009 21:08 schrieb Jonathan Cast: On Fri, 2009-02-13 at 12:15 -0700, John A. De Goes wrote: On Feb 13, 2009, at 12:07 PM, Jonathan Cast wrote: Exactly! But if it fails, why on earth should any other use

Re: [Haskell-cafe] Is using Data.Dynamic considered a no-go?

2009-02-12 Thread Jonathan Cast
On Thu, 2009-02-12 at 19:04 +0100, Lennart Augustsson wrote: They are not unsafe in the way unsafePerformIO is, I beg permission to demur: newtype Unsafe alpha = Unsafe { unUnsafe :: alpha } instance Typeable (Unsafe alpha) where typeOf _ = typeOf () pseudoSafeCoerce :: alpha - Maybe

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread Jonathan Cast
On Fri, 2009-02-13 at 10:34 +1100, John Ky wrote: Hi Haskell Cafe, I tried using type families over functions, but when I try it complains that the two lines marked conflict with each other. class Broadcast a where type Return a broadcast :: a - Return a instance Broadcast [a -

Re: [Haskell-cafe] Another point-free question (=, join, ap)

2009-02-12 Thread Jonathan Cast
On Thu, 2009-02-12 at 23:36 +, Edsko de Vries wrote: Hi, I can desugar do x' - x f x' as x = \x - f x' which is clearly the same as x = f However, now consider do x' - x y' - y f x' y' desugared, this is x = \x - y = \y' - f x' y' I

Re: [Haskell-cafe] Haddock Markup

2009-02-12 Thread Jonathan Cast
On Fri, 2009-02-13 at 13:30 +1300, Richard O'Keefe wrote: Let's take this example from the web. math mrow msup mix/mimn2/mn /msup mo+/mo mrow mn4/mnmoInvisibleTimes;/momix/mi /mrow mo+/mo mn4/mn /mrow /math NB: This example is *precisely* why I will never adopt MathML as an authoring

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread Jonathan Cast
On Fri, 2009-02-13 at 11:15 +1100, John Ky wrote: Hi Johnaton, Ah yes. That makes sense. Is there a way to define type r to be all types except functions? Not without overlapping instances. I *think* if you turn on {-# LANGUAGE OverlappingInstances #-} then instance Broadcast r where

Re: [Haskell-cafe] Re: Haddock

2009-02-06 Thread Jonathan Cast
On Fri, 2009-02-06 at 09:40 +0100, David Waern wrote: 2009/2/6 Max Rabkin max.rab...@gmail.com: On Thu, Feb 5, 2009 at 4:25 PM, David Waern david.wa...@gmail.com wrote: As for running arbitrary commands, I think we are opening up to a lot of unfamiliar syntax. I'd like to hear what everyone

Re: [Haskell-cafe] Re: Haskell tutorial for pseudo users?

2009-02-06 Thread Jonathan Cast
On Fri, 2009-02-06 at 14:56 +0100, Deniz Dogan wrote: 2009/2/6 Jonathan Cast jonathancc...@fastmail.fm: Emacs' terminal is also lacking all the modern conveniences, like addressable cursors and builtin line-editing designed for 1970s printing terminals and practically no searching

Re: [Haskell-cafe] Bind as a sequencing operator (Was: evaluation semantics of bind)

2009-02-05 Thread Jonathan Cast
On Thu, 2009-02-05 at 11:47 -0700, m...@justinbogner.com wrote: Jake McArthur j...@pikewerks.com writes: m...@justinbogner.com wrote: | Oops, sent this off list the first time, here it is again. | | Jake McArthur j...@pikewerks.com writes: | m...@justinbogner.com wrote: | | Bind is a

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Jonathan Cast
On Thu, 2009-02-05 at 20:46 +0100, Lennart Augustsson wrote: You are absolutely right. The statement The values of the IO monad are programs that do IO. is somewhat nonsensical. Values don't do anything, they just are. Technically, programs don't do anything either. I think of values of

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Jonathan Cast
On Thu, 2009-02-05 at 12:21 -0800, David Leimbach wrote: On Thu, Feb 5, 2009 at 11:25 AM, Andrew Wagner wagner.and...@gmail.com wrote: I think the point of the Monad is that it works as a container of stuff, that still

Re: [Haskell-cafe] Just how unsafe is unsafe

2009-02-05 Thread Jonathan Cast
On Thu, 2009-02-05 at 16:11 -0500, Andrew Wagner wrote: So we all know the age-old rule of thumb, that unsafeXXX is simply evil and anybody that uses it should be shot (except when it's ok). I understand that unsafeXXX allows impurity, which defiles our ability to reason logically about

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Jonathan Cast
On Thu, 2009-02-05 at 13:01 -0800, David Leimbach wrote: On Thu, Feb 5, 2009 at 12:27 PM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Thu, 2009-02-05 at 12:21 -0800, David Leimbach wrote: On Thu, Feb 5, 2009 at 11:25 AM, Andrew Wagner

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Jonathan Cast
On Thu, 2009-02-05 at 15:52 -0800, David Leimbach wrote: On Thu, Feb 5, 2009 at 2:38 PM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Thu, 2009-02-05 at 13:01 -0800, David Leimbach wrote: On Thu, Feb 5, 2009 at 12:27 PM, Jonathan Cast

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Jonathan Cast
On Fri, 2009-02-06 at 00:51 +0100, Peter Verswyvelen wrote: On Thu, Feb 5, 2009 at 8:20 PM, ChrisK hask...@list.mightyreason.com wrote: Since this is strict there is no laziness and the code must evaluate the input and output State RealWorld to ensure they are not

Re: [Haskell-cafe] Haskell tutorial for pseudo users?

2009-02-05 Thread Jonathan Cast
On Mon, 2009-02-02 at 20:55 +, Andrew Coppin wrote: Deniz Dogan wrote: Learn You a Haskell for Great Good (http://learnyouahaskell.com/) Mmm, interesting. Does anybody else think it would be neat if GHCi really did colourise your input like that? Bleah. More terminal hacking to

Re: [Haskell-cafe] Re: Haskell tutorial for pseudo users?

2009-02-05 Thread Jonathan Cast
On Fri, 2009-02-06 at 08:30 +0100, Achim Schneider wrote: Jonathan Cast jonathancc...@fastmail.fm wrote: On Mon, 2009-02-02 at 20:55 +, Andrew Coppin wrote: Deniz Dogan wrote: Learn You a Haskell for Great Good (http://learnyouahaskell.com/) Mmm, interesting. Does

Re: [Haskell-cafe] Monad explanation

2009-02-04 Thread Jonathan Cast
On Wed, 2009-02-04 at 22:16 +0200, Tymur Porkuian wrote: For me, the key to understanding monads was that monad is a value that know how to apply functions to itself. Or, more correctly, a container that knows how to apply functions to whatever is inside it. Close. (Monads are not `values'

Re: [Haskell-cafe] Monad explanation

2009-02-04 Thread Jonathan Cast
On Wed, 2009-02-04 at 23:13 +0200, Tymur Porkuian wrote: Actually, I understand these types in terms of containers that override standard method of function application for their contents. Huh? You can't actually over-ride function application --- Haskell's built-in application always does

Re: [Haskell-cafe] Monad explanation

2009-02-04 Thread Jonathan Cast
On Wed, 2009-02-04 at 23:55 +0200, Tymur Porkuian wrote: Huh? You can't actually over-ride function application --- Haskell's built-in application always does exactly the same thing, at every type. It's a metaphor. Oh, right. That one word that means `inaccurate way of putting things'!

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Jonathan Cast
On Thu, 2009-02-05 at 01:10 +0100, Manlio Perillo wrote: Yitzchak Gale ha scritto: In our case, the Python division first does a quick estimate of the sizes of the two integers, and just returns zero if it sees that there will be underflow on conversion to double. So I made the following

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

2009-02-03 Thread Jonathan Cast
On Tue, 2009-02-03 at 13:18 -0700, John A. De Goes wrote: Nor does it need one: http://www.csszengarden.com/ Can I write one if I really, really want to? I don't think excluding programmers from control over layout is much better than excluding non-programmers, really. jcc

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Jonathan Cast
On Mon, 2009-02-02 at 17:30 +0100, Krzysztof Skrzętnicki wrote: Do they? Haskell is a programing language. Therefore legal Haskell types has to be represented by some string. And there are countably many strings (of which only a subset is legal type representation, but that's not important).

Re: [Haskell-cafe] why typeRepArgs (typeOf hello) is [Char] ?

2009-02-02 Thread Jonathan Cast
On Mon, 2009-02-02 at 21:09 +0100, minh thu wrote: Hello, With Data.Typeable : *Graph typeRepArgs (typeOf 1) [] *Graph typeRepArgs (typeOf 'a') [] *Graph typeRepArgs (typeOf True) [] *Graph typeRepArgs (typeOf hello) [Char] I don't understand why the latter is not []. Could

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

2009-02-02 Thread Jonathan Cast
On Mon, 2009-02-02 at 13:28 -0800, Conal Elliott wrote: On Mon, Feb 2, 2009 at 11:39 AM, Creighton Hogg wch...@gmail.com wrote: 2009/1/29 Conal Elliott co...@conal.net: Hi Achim, I came to the same conclusion: I want to sweep aside these OO,

Re: [Haskell-cafe] space leak with 'concat' ?

2009-01-27 Thread Jonathan Cast
On Tue, 2009-01-27 at 22:12 +0100, Henning Thielemann wrote: $ ghc +RTS -M16m -c30 -RTS -e 'concat $ repeat bla' This breaks down after a while, also if I increase the memory restriction: ... ablablablablablablablablablablablablablablablablablablablablablaHeap exhausted; Current maximum

Re: Laws and partial values (was: [Haskell-cafe] mapM_ - Monoid.Monad.map)

2009-01-25 Thread Jonathan Cast
On Sat, 2009-01-24 at 03:08 -0700, Luke Palmer wrote: On Sat, Jan 24, 2009 at 2:40 AM, Ryan Ingram ryani.s...@gmail.com wrote: On Fri, Jan 23, 2009 at 10:49 PM, Thomas Davie tom.da...@gmail.com wrote: Isn't the point of bottom that it's the least defined

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-25 Thread Jonathan Cast
On Sun, 2009-01-25 at 10:46 +0100, Thomas Davie wrote: On 25 Jan 2009, at 10:08, Daniel Fischer wrote: Am Sonntag, 25. Januar 2009 00:55 schrieb Conal Elliott: It's obvious because () is a defined value, while bottom is not - per definitionem. I wonder if this argument is

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-25 Thread Jonathan Cast
On Sun, 2009-01-25 at 09:04 -0800, Conal Elliott wrote: On Sun, Jan 25, 2009 at 7:11 AM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Sun, 2009-01-25 at 10:46 +0100, Thomas Davie wrote: On 25 Jan 2009, at 10:08, Daniel Fischer wrote: Am

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-25 Thread Jonathan Cast
On Sun, 2009-01-25 at 10:46 -0700, Luke Palmer wrote: On Sun, Jan 25, 2009 at 10:17 AM, Jonathan Cast jonathancc...@fastmail.fm wrote: Yes. If you've got a set of terminating computations, and it has multiple distinct

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-25 Thread Jonathan Cast
On Sun, 2009-01-25 at 10:09 -0800, Conal Elliott wrote: On Sun, Jan 25, 2009 at 9:17 AM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Sun, 2009-01-25 at 09:04 -0800, Conal Elliott wrote: On Sun, Jan 25, 2009 at 7:11 AM, Jonathan Cast

  1   2   3   4   5   6   >