Re: [Haskell-cafe] Problem with HXT `when`

2013-09-24 Thread Albert Y. C. Lai
On 13-09-21 05:13 AM, Vlatko Basic wrote: I'd like to extract A texts from row with header Caption, and have come up with this runX $ doc (deep (hasName tr) -- filter only TRs withTraceLevel 5 traceTree -- shows

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Albert Y. C. Lai
On 13-09-20 07:47 AM, damodar kulkarni wrote: *Main sqrt (10.0) ==3.1622776601683795 True [...] *Main sqrt (10.0) ==3.16227766016837956435443343 True This is not even specific to Haskell. Every language that provides floating point and floating point equality does this. (To date,

Re: [Haskell-cafe] Proposal: New syntax for Haskell

2013-09-16 Thread Albert Y. C. Lai
A specification language is desirable. (Test cases are special cases of specifications. Test-driven development is a revival of the waterfall process.) For specifying interactions (computer-computer or computer-human), I recommend live sequence charts of David Harel, or generally any one based

Re: [Haskell-cafe] GLFW not working in Cabal 1.18

2013-09-12 Thread Albert Y. C. Lai
On 13-09-10 09:27 PM, Thiago Negri wrote: The package GLFW is not building in Cabal 1.18. Setup.hs [1] depends on `rawSystemStdInOut` [2] that changed signature between 1.16 and 1.18. Consider cabal install --cabal-lib-version=1.16. Replace 1.16 by the correct number. Use ghc-pkg list Cabal

Re: [Haskell-cafe] Readable GHC 7.6.3 docs (Bootstrapped)

2013-09-11 Thread Albert Y. C. Lai
On 13-09-11 07:31 AM, Obscaenvs wrote: since the official version is a bit too TimesNewRoman-y for my ...developed taste. I question that. Is it the official CSS, or is it your own browser setting? I see no TimesNewRoman-y here. The official version in my Firefox (Ubuntu 13.04 Desktop):

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Albert Y. C. Lai
On 13-09-01 02:02 AM, yi lu wrote: I have noticed if *bar* is predefined or it is a number, it can be used as arguments. But can other strings be used this way? Like in bash, we can use *ping 127.0.0.1* where *127.0.0.1* is an argument. Does Bash have a rich type system, like Haskell? Does

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Albert Y. C. Lai
On 13-09-01 02:41 AM, Mateusz Kowalczyk wrote: It's a bit like asking whether you can do addition everywhere by just typing the numbers to each other (no cheating and defining number literals as functions ;) ). To your horror, common math language does some of that. When 3 and ½ are typed

Re: [Haskell-cafe] sequence causing stack overflow on pretty small lists

2013-08-26 Thread Albert Y. C. Lai
On 13-08-26 04:46 AM, Niklas Hambüchen wrote: Effectively, sequence is a partial function. (Note: We are not trying to obtain a lazy list of random numbers, use any kind of streaming or the likes. We want the list in memory and use it.) We noticed that this problem did not happen if sequence

Re: [Haskell-cafe] GHC and backwards compatibility

2013-08-19 Thread Albert Y. C. Lai
On 13-08-19 10:58 AM, Ketil Malde wrote: b) the output isn't very helpful in tracking down the cause of this problem, it claims that all these packages depend on array-0.4.0.1, which is a lie. Somewhere, somehow, somethings depends on this (or at least a newer version), but I have no clue how

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Albert Y. C. Lai
On 13-08-16 03:29 PM, Dan Burton wrote: Idioms are oblivious, arrows are meticulous, monads are promiscuous http://homepages.inf.ed.ac.uk/wadler/papers/arrows-and-idioms/arrows-and-idioms.pdf I much recommend this paper. Underrated, underknown, pinpointing, unifying.

Re: [Haskell-cafe] Haskell Platform and Leksah on Windows

2013-08-07 Thread Albert Y. C. Lai
On 13-08-07 01:18 AM, Mihai Maruseac wrote: Anyway, he blogged about his problems at http://dorinlazar.ro/haskell-platform-windows-crippled/ and I'm sure that we can work on fixing some of them. To learn Haskell on Windows, and with Haskell Platform already installed, it is very easy and KISS

Re: [Haskell-cafe] Alternative name for return

2013-08-06 Thread Albert Y. C. Lai
On 13-08-06 01:14 AM, J. Stutterheim wrote: N.B. I am _not_ proposing that we actually change the name of `return`. I do currently have the opportunity to pick names for common functions in a non-Haskell related project, so I was wondering if there perhaps is a better name for `return`. I

Re: [Haskell-cafe] Getting the 'ThreadId' of the calling thread

2013-08-01 Thread Albert Y. C. Lai
On 13-07-29 08:35 AM, Nikita Karetnikov wrote: I feel that a 'myThreadId' action, which is defined in this module [1], is useless, but I'm not sure. I think it will always return the Map.find: element not in the map exception because a 'threadMap' contains an empty 'ThreadMap'. Is it right, or

Re: [Haskell-cafe] Catch multiple exceptions using 'Control.Exception'

2013-07-07 Thread Albert Y. C. Lai
On 13-07-06 12:12 PM, Nikita Karetnikov wrote: Is there an open sum type or a closed existential type? OCaml has open sum types. I haven't really seen closed existential types. (I have seen some approximations, but each lacks one last bit.) ___

Re: [Haskell-cafe] Upgrading GHC 7.6.3 global packages to latest versions

2013-07-02 Thread Albert Y. C. Lai
On 13-06-28 04:06 AM, Rouan van Dalen wrote: Now when I try to install the latest version of the [time] package, I have 2 time packages, 1 in the global package db (the older version), and 1 in the user package db (the newer version). Now I would like subsequent installed packages to always use

Re: [Haskell-cafe] ANN: custom-hackage

2013-06-16 Thread Albert Y. C. Lai
On 13-06-13 11:09 AM, Niklas Hambüchen wrote: https://github.com/nh2/custom-hackage An (almost trivial) script to generate 00-index.tar.gz which is necessary to run your own `remote-repo`. I write the following critique with much reluctance, since I will be saying a lot of this cannot

Re: [Haskell-cafe] Cabal config file Guide

2013-05-26 Thread Albert Y. C. Lai
On 13-05-25 04:52 PM, Daniel Díaz Casanueva wrote: As you already know, cabal-install is configured in the file config. It has a lot of fields, but I didn't find a single place where each field is explained with detail. There is none, but my new and timely

Re: [Haskell-cafe] runhaskell flags: What is going on?

2013-05-04 Thread Albert Y. C. Lai
On 13-05-03 10:35 AM, Niklas Hambüchen wrote: runhaskell -fno-warn-unused-matches Myfile.hs [no output whatsoever but exit code 127] runhaskell -fasdf Myfile.hs [no output whatsoever but exit code 127] $ runghc --help Usage: runghc [runghc flags] [GHC flags] module [program args] The

[Haskell-cafe] conditional branching vs pattern matching: pwn3d by GHC

2013-04-22 Thread Albert Y. C. Lai
When I was writing http://www.vex.net/~trebla/haskell/crossroad.xhtml I wanted to write: branching on predicates and then using selectors is less efficient than pattern matching, since selectors repeat the tests already done by predicates. It is only ethical to verify this claim before

Re: [Haskell-cafe] customizing haskeline?

2013-04-16 Thread Albert Y. C. Lai
On 13-04-14 10:22 PM, Evan Laforge wrote: I tried to colorize a haskeline prompt by putting control characters in it, but line editing was hopelessly confused, presumably because haskeline doesn't understand control characters and thought the prompt was longer than it really was.

Re: [Haskell-cafe] Building the Haskell Platform in Linux

2013-04-14 Thread Albert Y. C. Lai
On 13-04-13 12:19 AM, Daniel Díaz Casanueva wrote: Hi cafe! Probably you all know how to do this, but I myself found confused when building the Haskell Platform in Linux for my first time. I was using Linux for my first time too! The first problem I encountered was to decide what linux packages

Re: [Haskell-cafe] Building the Haskell Platform in Linux

2013-04-14 Thread Albert Y. C. Lai
On 13-04-14 08:12 PM, Daniel Díaz Casanueva wrote: By the way, a random question, what's the memory of the computer you used to build the Platform? I have always used my laptop with 3GB RAM. I have not measured how much is actually needed, or what happens if I provide less.

Re: [Haskell-cafe] Haskell is a declarative language? Let's see how easy it is to declare types of things.

2013-04-06 Thread Albert Y. C. Lai
On 13-04-05 04:56 AM, Tom Ellis wrote: any is very ambiguous. Doesn't the problem go away if you replace it with all? Yes, that is even better. The world would be simple and elegant if it did things your way, and would still be not too shabby if it did things my way, no? «Learn You a

Re: [Haskell-cafe] Haskell is a declarative language? Let's see how easy it is to declare types of things.

2013-04-04 Thread Albert Y. C. Lai
On 13-04-04 01:07 AM, wren ng thornton wrote: When the quantifiers are implicit, we can rely on the unique human ability to DWIM. This is a tremendous advantage when first teaching people about mathematical concerns from a logical perspective. However, once people move beyond the basics of

Re: [Haskell-cafe] Haskell is a declarative language? Let's see how easy it is to declare types of things.

2013-04-03 Thread Albert Y. C. Lai
On 13-04-03 07:39 PM, Alexander Solla wrote: There's your problem. Mathematicians do this specifically because it is helpful. If anything, explicit quantifiers and their interpretations are more complicated. People seem to naturally get how scoping works in mathematics until they have to

Re: [Haskell-cafe] cabal install pandoc

2013-04-01 Thread Albert Y. C. Lai
On 13-04-01 06:26 AM, Roger Mason wrote: It turned out that there was a stale version of 'array' lurking in the ghc package db. In spite of reinstalling ghc it did not go away until I unregistered it. I think it was persisting because re-installing ghc simply unpacked over the old directory

Re: [Haskell-cafe] A Thought: Backus, FP, and Brute Force Learning

2013-03-20 Thread Albert Y. C. Lai
On 13-03-20 06:54 PM, OWP wrote: For me personally, one thing I enjoy about a typical procedural program is that it allows me to Brute Force Learn. [...] 1. I believe that you can also stare at functional programs and figure out as much as what you can with procedural programs. It only

Re: [Haskell-cafe] Compiled program using OpenGL fails to trigger GPU switch on Mac, but works in GHCi

2013-03-18 Thread Albert Y. C. Lai
On 13-03-18 09:19 AM, Jesper Särnesjö wrote: Interestingly, running the program in GHCi with the -fno-ghci-sandbox flag, causes it to misbehave in the same way as when compiled: Then perhaps to mimic default ghci in hope of getting good results: - compile with -threaded (more candidly, link

Re: [Haskell-cafe] To seq or not to seq, that is the question

2013-03-10 Thread Albert Y. C. Lai
On 13-03-08 11:53 PM, Edward Z. Yang wrote: Are these equivalent? If not, under what circumstances are they not equivalent? When should you use each? evaluate a return b a `seq` return b return (a `seq` b) Let a = div 0 0 (or whatever pure but problematic expression you like)

Re: [Haskell-cafe] translating recursively defined sequence

2013-03-05 Thread Albert Y. C. Lai
On 13-03-05 12:19 AM, Christopher Howard wrote: Hi. My Haskell is (sadly) getting a bit rusty. I was wondering what would be the most straightforward and easily followed procedure for translating a recursively defined sequence into a Haskell function. For example, this one from a homework

Re: [Haskell-cafe] cabal install ghc-mod installs 3 years old version

2013-03-01 Thread Albert Y. C. Lai
On 13-03-01 05:10 AM, Malcolm Wallace wrote: Doesn't Cabal tend to install library packages under the .cabal folder? So blowing it away gets rid of the problematic ones. (And everything else.) You need to perform scientific experiments to refute that claim, then see my

Re: [Haskell-cafe] package dependencies should distinguish between API and implementation?

2013-02-26 Thread Albert Y. C. Lai
On 13-02-25 06:50 AM, Johannes Waldmann wrote: or in general, A (and B.1) are baked into ghc, but there is some B.2/B.3 out there which U wants to use. Or is this what already happens? (ghc would notice that B.1.foo is different from B.2.foo. cabal-install would warn, but proceed? Then the

Re: [Haskell-cafe] How to input Unicode string in Haskell program?

2013-02-22 Thread Albert Y. C. Lai
On 13-02-21 04:58 AM, Semyon Kholodnov wrote: — Windows console is locked to one specific local code page, and no codepage contains Latin-1, Cyrillic and Kanji symbols at the same time. Windows console is not locked to an anti-international code page; it is only defaulted to. Use CHCP 65001

Re: [Haskell-cafe] question about: --hyperlink-source

2013-02-22 Thread Albert Y. C. Lai
On 13-02-21 05:18 AM, Doaitse Swierstra wrote: I ran into the problem that for the packages which I install using cabal install The generated html does not contain links to the sources. This issue was raised before in:

Re: [Haskell-cafe] Next Meetup

2013-02-04 Thread Albert Y. C. Lai
On 13-02-04 02:56 AM, Alfredo Di Napoli wrote: Reverse engineering (aka Google searching) for Hacklab seems to reveal that the location is Edimburgh: Correct? :D There are many Hacklabs worldwide. But this one is Toronto, Canada. I know because Christopher runs the Toronto Haskell Meetup and

[Haskell-cafe] TIPS: To Insure Package Sanity

2013-01-30 Thread Albert Y. C. Lai
If you possess multiple instances (may be different versions, may be same version different builds) of a package, life can be hard and confusing. The problems are explained in my http://www.vex.net/~trebla/haskell/sicp.xhtml and faced by many people regularly. (Just read this mailing list.)

Re: [Haskell-cafe] why no replace function in our regular expression libs ?

2013-01-25 Thread Albert Y. C. Lai
On 13-01-25 02:06 PM, Simon Michael wrote: People have put a lot of work into regular expression libraries on haskell. Yet it seems very few of them provide a replace/substitute function - just regex-compat and regepr as far as I know. Why is that ? [...] Secondly, as of today what do y'all do

Re: [Haskell-cafe] 9.3 - (2 * 4.5) = 0.3000000000000007

2013-01-16 Thread Albert Y. C. Lai
On 13-01-16 10:04 AM, Luis Cabellos wrote: You should read http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.22.6768 If you want to be efficient with floats. Language independent. And also http://floating-point-gui.de/ ___ Haskell-Cafe

Re: [Haskell-cafe] How to disable document in .cabal file?

2013-01-15 Thread Albert Y. C. Lai
On 13-01-15 12:06 AM, Magicloud Magiclouds wrote: I have enabled document in .cabal/config, so I could get document every time I installed libraries or so. But when I compile my own applications, it also takes time on generating non-exist documents. How to disable it just for this project?

Re: [Haskell-cafe] How to disable document in .cabal file?

2013-01-15 Thread Albert Y. C. Lai
On 13-01-15 09:10 PM, Magicloud Magiclouds wrote: So the only way is to use param every time I build this certain project? Really hoping I could disable it in project.cabal The param is for cabal install only. So don't use cabal install. cabal configure # may be skipped usually cabal

Re: [Haskell-cafe] help diagnosing space leak with IORef/STRef, just incrementing a million times.

2013-01-06 Thread Albert Y. C. Lai
On 13-01-07 12:12 AM, Thomas Hartman wrote: I have a space leak in a function that increments a number inside IORef or STRef (either lazy or strict). IORef and STRef operations do not automatically evaluate contents. writeIORef r (x + 1) simply stores a pointer to the expression (thunk) x +

Re: [Haskell-cafe] Makefile for a Haskell Project

2013-01-04 Thread Albert Y. C. Lai
On 13-01-02 01:01 AM, xuan bach wrote: = BASEDIR=/usr/local INCS= -I$(BASEDIR)/include/omega -I. LIBS= -L$(BASEDIR)/lib LIB= -lcode_gen -lomega -lm GHC=ghc # CFILES=$(CURDIR)/cfile HSFILES=$(CURDIR)/hsfile

Re: [Haskell-cafe] Cabal bug? repeat --reinstall

2013-01-04 Thread Albert Y. C. Lai
On 13-01-04 04:36 PM, Niklas Hambüchen wrote: I get the following: $ cabal install --only-dependencies --reinstall Resolving dependencies... All the requested packages are already installed: Use --reinstall if you want to reinstall anyway. Can somebody confirm that they see the same? I

Re: [Haskell-cafe] Best approach to avoid dependency hells

2012-12-08 Thread Albert Y. C. Lai
On 12-12-08 07:39 AM, Ivan Perez wrote: When you install A, you may not know that you'll need to depend on a lower version of bytestring later on. Cabal will pick the highest version available (0.10 if present). If a program you install later on depends on A (needs bytestring-0.10) and ghc

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-07 Thread Albert Y. C. Lai
On 12-12-05 12:48 AM, Jason Dagit wrote: I thought it was possible to get around this with lazy patterns such Wadler's force function [1]? (untested code) force y = let Just x = y in Just x lazyDecode :: FromJSON a = ByteString - Maybe a lazyDecode = force . decode This says, the type

Re: [Haskell-cafe] Best approach to avoid dependency hells

2012-12-07 Thread Albert Y. C. Lai
On 12-12-05 01:52 PM, Ivan Perez wrote: I've spent the last couple of days fighting my way around a dependency hell with my own libraries and packages. If I install them package by package (by hand), I'm very likely to hit one of these conflicts that I'm talking about. A simple example of

Re: [Haskell-cafe] How to incrementally update list

2012-12-02 Thread Albert Y. C. Lai
On 12-11-30 01:16 PM, Mark Thom wrote: Is there a paper or other single resource that will help me thoroughly understand non-strictness in Haskell? See my http://www.vex.net/~trebla/haskell/lazy.xhtml ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] cabal configure cabal build cabal install

2012-11-27 Thread Albert Y. C. Lai
On 12-11-27 04:40 AM, kudah wrote: On Tue, 27 Nov 2012 02:20:35 -0500 Albert Y. C. Lai tre...@vex.net wrote: When cabal build succeeds, it always says: (older) registering name-version (newer) In-place registering name-version That's what it says. But use ghc-pkg and other tests to verify

Re: [Haskell-cafe] cabal configure cabal build cabal install

2012-11-26 Thread Albert Y. C. Lai
On 12-11-26 04:34 AM, Kim-Ee Yeoh wrote: Nice tip, Albert! Good to know! One question I have is, is (runghc Setup.lhs) equivalent to (cabal) in runghc Setup.lhs $ [configure, build, install] ? Setup defaults to --global --prefix=/usr/local cabal defaults to --user --prefix=$HOME/.cabal This

Re: [Haskell-cafe] cabal configure cabal build cabal install

2012-11-26 Thread Albert Y. C. Lai
On 12-11-27 01:02 AM, kudah wrote: On Mon, 26 Nov 2012 18:21:33 -0500 Albert Y. C. Lai tre...@vex.net wrote: Lastly, there is no Setup install. Use copy and register. $ runghc Setup.hs --help [...] install Copy the files into the install locations. Run register. copy

[Haskell-cafe] cabal configure cabal build cabal install

2012-11-25 Thread Albert Y. C. Lai
Among many programmers, and/or users who manually unpack source tarball before installing, this idiom is very common: cabal configure cabal build cabal install This idiom is an urban legend, i.e., a popular error. cabal install re-does the configure and the build steps, among other things.

Re: [Haskell-cafe] Cabal failures...

2012-11-20 Thread Albert Y. C. Lai
On 12-11-20 08:48 AM, Gregory Guthrie wrote: It was also interesting to note a comment that most developers don't have access to a Windows machine for testing. With Windows at 90% of the computing market (Linux = 1.6%), this seems like a problem which might limit growth of Haskell usage.

Re: [Haskell-cafe] Compilers: Why do we need a core language?

2012-11-20 Thread Albert Y. C. Lai
On 12-11-20 06:54 AM, c...@lavabit.com wrote: I know nothing about compilers and interpreters. I checked several books, but none of them explained why we have to translate a high-level language into a small (core) language. Is it impossible (very hard) to directly translate high-level language

Re: [Haskell-cafe] Hackage dependencies problem.

2012-11-20 Thread Albert Y. C. Lai
On 12-11-19 09:39 PM, Magicloud Magiclouds wrote: And, the key point is that using upgrade-dependencies with cabal-install. I am using git (current) version of cabal-install. Without that argument, things could be fine. With it, it must fail. Therefore, don't use upgrade-dependencies.

Re: [Haskell-cafe] Cabal failures...

2012-11-20 Thread Albert Y. C. Lai
On 12-11-20 05:37 PM, Gregory Guthrie wrote: No; the first sentence says that someone else had reported that testing on Windows was hard to do because of (a perceived) lack of access to Windows by Haskell developers... The implication is that Haskell developers (only/mainly) use *nix. I

Re: [Haskell-cafe] Cabal failures...

2012-11-20 Thread Albert Y. C. Lai
On 12-11-20 08:20 PM, Johan Tibell wrote: This logic is flawed. More than 90% of computers having Windows doesn't imply that 90% of all computers in a given household runs Windows. What's the probability that your household has a Windows computer if you're a programmer that don't live with your

Re: [Haskell-cafe] Hackage dependencies problem.

2012-11-19 Thread Albert Y. C. Lai
On 12-11-19 04:45 AM, Ivan Lazar Miljenovic wrote: On 19 November 2012 18:21, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: command line: cannot satisfy -package Cabal-1.16.0: Cabal-1.16.0-dd0ce1db6fea670a788547ee85411486 is unusable due to missing or recursive dependencies:

Re: [Haskell-cafe] Cabal failures...

2012-11-19 Thread Albert Y. C. Lai
On 12-11-19 04:25 PM, Gregory Guthrie wrote: I am not exert in the area, but I wonder how /why/ this is different than other package managers, like apt in Linux, I have never had any problems with it, and I would think that their dependencies are of at least similar complexities. I feel very

Re: [Haskell-cafe] need help with understanding expression

2012-11-17 Thread Albert Y. C. Lai
On 12-11-17 02:19 AM, damodar kulkarni wrote: Let's see tthis: Prelude :t 3 a 3 a :: (Num ([Char] - t)) = t No complaint from GHC; but now see this: Prelude :t a 3 interactive:1:0: Couldn't match expected type `t1 - t' against inferred type `[Char]' In the expression: a

Re: [Haskell-cafe] need help with understanding expression

2012-11-16 Thread Albert Y. C. Lai
On 12-11-16 02:10 AM, Daryoush Mehrtash wrote: I am having hard time understanding how removing the outer parenthesis in (max.(+1)) 2 2 to max.(+1) 2 2 changes the meaning of expression. I recommend http://bm380.user.srcf.net/prettyparsetree.cgi for discovering the correct parse.

Re: [Haskell-cafe] Profiling a project with cabal and cabal-dev

2012-11-10 Thread Albert Y. C. Lai
On 12-11-07 12:00 AM, Mike Craig wrote: Got it. Thanks for the info, Erik. I've updated my cabal config and reinstalled some of the global packages, and the world seems much less bleak! :) The good news is that whatever comes with GHC comes with profiling, you do not need to reinstall them.

Re: [Haskell-cafe] Where is the documentation on exception types kept?

2012-11-07 Thread Albert Y. C. Lai
On 12-11-07 03:36 PM, timothyho...@seznam.cz wrote: I am trying to catch an thread blocked on MVar indefinitely exception. Of course I can use ::SomeException as explained in http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception.html#g:3 but there is no explanation

Re: [Haskell-cafe] referential transparency? (for fixity of local operators)

2012-10-06 Thread Albert Y. C. Lai
On 12-10-06 05:18 AM, Johannes Waldmann wrote: wren ng thornton wren at freegeek.org writes: As for whether the default should be infix 9 instead of infixl 9 ... that was exactly the point of my message. - J. Perhaps, half of the people want infixl, another half of the people want infixr,

Re: [Haskell-cafe] Monads

2012-10-01 Thread Albert Y. C. Lai
On 12-10-01 05:34 AM, Jon Fairbairn wrote: Albert Y. C. Lai tre...@vex.net writes: On 12-09-30 06:33 PM, Jake McArthur wrote: When discussing monads, at least, a side effect is an effect that is triggered by merely evaluating an expression. A monad is an interface that decouples effects from

Re: [Haskell-cafe] Monads

2012-09-30 Thread Albert Y. C. Lai
On 12-09-29 09:57 PM, Vasili I. Galchin wrote: I would an examples of monads that are pure, i.e. no side-effects. What does side effect mean, to you? Definition? Because some people say State has no side effect, and some other people say State has side effects. The two groups use

Re: [Haskell-cafe] Monads

2012-09-30 Thread Albert Y. C. Lai
On 12-09-30 06:33 PM, Jake McArthur wrote: When discussing monads, at least, a side effect is an effect that is triggered by merely evaluating an expression. A monad is an interface that decouples effects from evaluation. I don't understand that definition. Or maybe I do subconsciously. I

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Albert Y. C. Lai
On 12-09-14 05:18 PM, Andrew Pennebaker wrote: One thing I want to double check is that Haskell does, in fact, automatically memoize all pure function calls. Is this true? A simple back-of-envelope calculation that immediately raises doubts: 2 seconds on a 2 GHz computer is 4x10^9 clock

Re: [Haskell-cafe] Data.Text UTF-8 question

2012-08-31 Thread Albert Y. C. Lai
On 12-08-31 01:59 AM, jeff p wrote: I have a sample file (attached) which I cannot read into Text: Prelude Control.Applicative Data.Text.IO.readFile foo *** Exception: utf8.txt: hGetContents: invalid argument (invalid byte sequence) Prelude Control.Applicative

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-15 Thread Albert Y. C. Lai
On 12-08-15 03:20 AM, wren ng thornton wrote: (forall a. P(a)) - Q = exists a. (P(a) - Q) For example: A. (forall p. p drinks) - (everyone drinks) B. exists p. ((p drinks) - (everyone drinks)) In a recent poll, 100% of respondents think A true, 90% of them think B paradoxical, and

[Haskell-cafe] but module Data.Array.Rep.Algorithms.Ramdomish is in package repa-algorithms

2012-08-12 Thread Albert Y. C. Lai
On 12-08-12 02:18 PM, KC wrote: I use cabal install repa but then WinGHCi says module Data.Array.Rep.Algorithms.Ramdomish not found. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] parsec: parserFail multiple error messages

2012-08-09 Thread Albert Y. C. Lai
On 12-08-08 03:24 PM, silly wrote: The problem is that when I try this parse integer 7 I get the following error: Left (line 1, column 6): unexpected end of input expecting digit integer overflow ie there are three error messages but I only want the last one. Is there something I

Re: [Haskell-cafe] why does a foldr not have a space leak effect?

2012-07-25 Thread Albert Y. C. Lai
On 12-07-25 09:06 AM, Mathieu Boespflug wrote: Albert Y. C. Lai tre...@vex.net writes: foldr (+) and foldl (+) for Int have the same asymptotic costs, both time and space. See my http://www.vex.net/~trebla/haskell/lazy.xhtml Therefore, I do not understand why they are labeled opposite space

Re: [Haskell-cafe] why does a foldr not have a space leak effect?

2012-07-24 Thread Albert Y. C. Lai
On 12-07-23 10:52 PM, Qi Qi wrote: Foldl has the space leak effect, and that's why foldl' has been recommended. foldr (+) and foldl (+) for Int have the same asymptotic costs, both time and space. See my http://www.vex.net/~trebla/haskell/lazy.xhtml Therefore, I do not understand why they

Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5

2012-07-20 Thread Albert Y. C. Lai
On 12-07-17 01:43 PM, Levent Erkok wrote: It still feels like this'll start biting more folks down the road. I've created the following cabal ticket so it can be tracked: https://github.com/haskell/cabal/issues/978 However, my understanding of the problem is rather incomplete; please feel free

Re: [Haskell-cafe] Getting a segmentation fault when starting/stopping the RTS, from C, several times.

2012-07-15 Thread Albert Y. C. Lai
On 12-07-10 11:35 PM, Brandon Allbery wrote: Quoth the Fine Manual (8.2.1.1. Using your own main() http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#using-own-main): There can be multiple calls to |hs_init()|, but each one should be matched by one (and only one) call to

Re: [Haskell-cafe] Getting a segmentation fault when starting/stopping the RTS, from C, several times.

2012-07-15 Thread Albert Y. C. Lai
On 12-07-15 08:37 PM, Felipe Almeida Lessa wrote: Would that be: Prog ::= nop | hs_init(); Prog'; hs_exit(); Prog' ::= nop | hs_init(); Prog'; hs_exit(); | Prog' Prog' Yeah, I keep forgetting that. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Bad interface problem.

2012-07-12 Thread Albert Y. C. Lai
On 12-07-11 09:28 PM, Magicloud Magiclouds wrote: And Albert, I did not directly install QuickCheck. It was required by yesod. I can't reproduce that dependency either. Output of cabal install --dry-run yesod does not contain QuickCheck or template-haskell. I do not have QuickCheck

Re: [Haskell-cafe] Bad interface problem.

2012-07-11 Thread Albert Y. C. Lai
On 12-07-11 05:28 AM, Magicloud Magiclouds wrote: I am using ghc 7.4.2 which includes template-haskell-2.7.0.0. When I installed QuickCheck-2.5, it requires template-haskell-2.6.0.0. Even I removed all user space packages, the error was still. Cannot reproduce. I start with ubuntu 11.04 x86

Re: [Haskell-cafe] Bad interface problem.

2012-07-05 Thread Albert Y. C. Lai
On 12-07-03 04:19 AM, Magicloud Magiclouds wrote: $ cabal --upgrade-dependencies --enable-documentation --force-reinstalls --solver=topdown QuickCheck-2.5 Test/QuickCheck/All.hs:15:1: Bad interface file: /home/magicloud/.cabal/lib/template-haskell-2.6.0.0/ghc-7.4.2/Language/Haskell/TH.hi

Re: [Haskell-cafe] Cabal problem re. haskelldb-hdbc-mysql

2012-07-05 Thread Albert Y. C. Lai
On 12-07-04 10:58 AM, Yves Parès wrote: the package http://hackage.haskell.org/package/haskelldb-hdbc-mysql/ the use of HDBC 2.3.0 I'm using cabal-install 0.14, and with a fresh install (no packages already installed), cabal-install tries to install HDBC-2.1.1 instead of, say, HDBC-2.2.7.0.

Re: [Haskell-cafe] cabal doens't forget old dependencies

2012-06-27 Thread Albert Y. C. Lai
On 12-06-27 11:29 AM, Sjoerd Visscher wrote: I tried to install reactive-banana. This failed due to a dependency conflict, and then I noticed there was a newer version of reactive-banana. So I did cabal update, and tried to install again. But whatever I do, cabal keeps trying to install

Re: [Haskell-cafe] ANNOUNCE : Leksah 0.12.1.2 (fixes some metadata issues)

2012-06-20 Thread Albert Y. C. Lai
On 12-06-20 07:59 PM, Hilco Wijbenga wrote: hilco@centaur ~ ~$ rm -rf .cabal/ I am not sure why you start with this. If you do this for a clean start, see my http://www.vex.net/~trebla/haskell/sicp.xhtml#remove for why it is not a clean start. If you do this for some other purpose,

Re: [Haskell-cafe] Issues with installing packages

2012-05-06 Thread Albert Y. C. Lai
On 12-05-05 04:19 PM, Graham Berks wrote: New to haskell and having issues resolving packages, have the following output below and can't seem to resolve it. Text seems to have diff hash dependancies when I try and instal a diff version of 0.11.2.0 etc Any ideas on what todo ?? Thanks $

Re: [Haskell-cafe] Learn you

2012-05-06 Thread Albert Y. C. Lai
On 12-05-06 01:58 AM, Tom Murphy wrote: FWIW, I loved the tone of those books, and I think it helps many people learn the material. It's nice to have a little reminder every once in a while: good job! Now go take a break; make some cookies - here's a recipe Learn_You_a_Baking_for_Great .

Re: [Haskell-cafe] MonadError vs Control.Exception

2012-05-05 Thread Albert Y. C. Lai
On 12-05-04 07:03 PM, Станислав Черничкин wrote: Hi, guys, I'm interested in best practices in using of each approach. Personally I like MonadError because it is more explicit and Control.Exception-s becomes really ugly in complex scenarios. [...] User has to deal with both, but have no

Re: [Haskell-cafe] Can't install snap (problem with syb)

2012-03-28 Thread Albert Y. C. Lai
On 12-03-28 06:30 PM, Brandon Allbery wrote: Did you also remove ~/.ghc? Libraries are actually installed and registered there, not under ~/.cabal. Reality is less simplistic than that. .ghc has library metadata. .cabal has library files. See my http://www.vex.net/~trebla/haskell/sicp.xhtml

Re: [Haskell-cafe] Are there arithmetic composition of functions?

2012-03-20 Thread Albert Y. C. Lai
On 12-03-19 10:05 PM, Richard O'Keefe wrote: http://www.haskell.org/onlinereport/haskell2010/haskellch9.html#x16-1710009 Haskell 2010 is already beginning to be out of date. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/16125/focus=16324

Re: [Haskell-cafe] Haskell showcase in 5 minutes

2012-02-29 Thread Albert Y. C. Lai
On 12-02-27 04:36 PM, rocon...@theorem.ca wrote: In less than 5 minutes I can solve NP-Complete problems in restaurant orders: http://www.reddit.com/comments/24p2c/xkcd_does_anyone_else_feel_compelled_to_solve_this/c24pc5 and right in haskell-cafe:

Re: [Haskell-cafe] Preventing leaked open file descriptors whencatching exceptions

2012-02-22 Thread Albert Y. C. Lai
I cannot reproduce pretty much any claim made in this thread. Unless PIO does not mean System.IO.Posix. I run mkfifo hello to create a named pipe. Then I run this program to keep trying to open for writing, non-blocking (without anyone at the read end initially): import System.Posix.IO

Re: [Haskell-cafe] GHC -WAll, -fwarn-unused-do-bind and Cabal

2012-02-15 Thread Albert Y. C. Lai
On 12-02-14 03:01 PM, JP Moresmau wrote: I'm confused: I'm using GHC 7.0.2 and Cabal 1.10.1.0 with cabal-install 0.10.2. I use -Wall in my Cabal file. If I build a Haskell file with unused do binds, via the GHC API I get no warning, which is normal, since the doc states: The warnings that are

Re: [Haskell-cafe] Stable pointers: use of cast to/from Ptr

2012-02-12 Thread Albert Y. C. Lai
On 12-02-12 09:18 AM, Yves Parès wrote: According to the documentation (http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Foreign-StablePtr.html), StablePtrs aims at being opaque on C-side. The doc multiply warns again and again that StablePtr, as well as whatever Ptr you get

Re: [Haskell-cafe] strict version of Haskell - does it exist?

2012-02-02 Thread Albert Y. C. Lai
http://www.vex.net/~trebla/haskell/lazy.xhtml It is half done. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] cabal-install package precedence with --extra-lib-dirs

2012-02-02 Thread Albert Y. C. Lai
On 12-02-02 12:12 AM, Scott Lawrence wrote: When running cabal install with --extra-lib-dirs=./lib, if a package is found both in ~/.cabal/lib and ./lib, cabal seems to favor the ~/.cabal/lib one. Is there some way to specify the correct precedence to use? --extra-lib-dirs is for C libs only.

Re: [Haskell-cafe] Stuck on HXT basics

2012-01-31 Thread Albert Y. C. Lai
On 12-01-30 08:06 AM, Pēteris Paikens wrote: import Text.XML.HXT.Core import Text.XML.HXT.DOM.XmlTreeFilter selectAllText :: ArrowXml a = a XmlTree XmlTree selectAllText = deep isXText Delete import Text.XML.HXT.DOM.XmlTreeFilter. Change isXText to isText. That is, import

Re: [Haskell-cafe] Just found GHCI can be used as a debugger

2012-01-25 Thread Albert Y. C. Lai
On 12-01-25 04:06 PM, Yves Parès wrote: 1) Is there some documentation about it? GHC comes with a user guide in HTML somewhere on your disk. It is also on the GHC website, but I much prefer everyone to know and find it on his/her disk first. People spend lifetimes browsing the web, and not

Re: [Haskell-cafe] Convert Double to Data.Fixed

2011-12-29 Thread Albert Y. C. Lai
On 11-12-26 10:55 AM, Eugene Kirpichov wrote: How do I most efficiently convert a Double to a Data.Fixed? Double is an instance of Real, Fixed E12 is an instance of Fractional, they are eligible for realToFrac. Similarly for many time types. ___

Re: [Haskell-cafe] strict, lazy, non-strict, eager

2011-12-28 Thread Albert Y. C. Lai
There are two flavours of MonadState, Control.Monad.State.Lazy and Control.Monad.State.Strict. There are two flavours of ByteString, Data.ByteString.Lazy and Data.Bytestring (whose doc says strict). There are two flavours of I/O libraries, lazy and strict. There are advices of the form: the

[Haskell-cafe] strict, lazy, non-strict, eager

2011-12-23 Thread Albert Y. C. Lai
Most individuals of the Haskell community have long been maintaining a cognitive dissonance; some cases turn into plain hypocrisy. You might excuse it for its ancient and prominent origin: Richard Bird and/or Philip Wadler themselves wrote like it is too lazy, make it more strict 13 years ago

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread Albert Y. C. Lai
On 11-12-04 07:08 AM, dokondr wrote: In GHC 7.0.3 / Mac OS X when trying to: writeFile someFile (Hoping You Have A iPhone When I Do This) Lol Sleep Is When You Close These ---gt; \55357\56384 I get: commitBuffer: invalid argument (Illegal byte sequence) The string I am trying to write can

Re: [Haskell-cafe] A Mascot

2011-11-22 Thread Albert Y. C. Lai
On 11-11-22 12:22 AM, Jeremy Shaw wrote: A mascot is supposed to represent characteristics, emotions, or desires that a particular group of people aspire to have, be like, etc. To outsiders, it provides a quick way to see if it might be a group they would like to belong to, and for insiders, it

  1   2   3   4   >