Re: [Haskell-cafe] Non-greedy match in Text.Regx.Posix

2012-07-17 Thread Roman Cheplyaka
* C K Kashyap ckkash...@gmail.com [2012-07-17 13:31:05+0530] I was exploring Text.Regex.Posix and found that I was not able to do a non-greedy match by modifying the quantifier with a ?. How can I achieve non-greedy match in Text.Regex.Posix? POSIX regular expressions semantics doesn't have a

Re: [Haskell-cafe] Control defaulting in ghci

2012-07-13 Thread Roman Cheplyaka
* Patrick Palka patr...@parcs.ath.cx [2012-07-08 14:39:26-0400] On 7/8/2012 11:28 AM, Roman Cheplyaka wrote: Is there a way to control defaulting in ghci? (Like the default declaration in source files does.) ghci 7.4.1 doesn't accept default declarations. I tried loading a module

Re: [Haskell-cafe] [Haskell] ANNOUNCE: control-monad-loop 0.1

2012-07-11 Thread Roman Cheplyaka
* Joey Adams joeyadams3.14...@gmail.com [2012-07-09 14:29:43-0400] Also, it's not obvious how your tests work. Please consider using HUnit and test-framework (or similar) to organize them. The tests currently aren't automated. It's hard to write an automated test to make sure a program

Re: [Haskell-cafe] [Haskell] ANNOUNCE: control-monad-loop 0.1

2012-07-09 Thread Roman Cheplyaka
* Joey Adams joeyadams3.14...@gmail.com [2012-07-09 01:38:06-0400] This package provides imperative-style loops supporting continue and break. For example: import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.Loop import Control.Monad.Trans.Class

[Haskell-cafe] Control defaulting in ghci

2012-07-08 Thread Roman Cheplyaka
Is there a way to control defaulting in ghci? (Like the default declaration in source files does.) ghci 7.4.1 doesn't accept default declarations. I tried loading a module with a default declaration, but that also didn't affect the ghci session. It would be ironic if this is possible in source

Re: [Haskell-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-23 Thread Roman Cheplyaka
Hi, 1. Minor correction for your tutorial: reverse . reverse = id is called the involution property, not idempotency. 2. Writing haddock documentation would definitely increase the chances for GenCheck wide adoption. -- Roman I. Cheplyaka :: http://ro-che.info/

Re: [Haskell-cafe] lightweight alternative to mtl?

2012-06-16 Thread Roman Cheplyaka
* Anton Kholomiov anton.kholom...@gmail.com [2012-06-16 17:59:23+0400] It's class for strict and lazy states. Maybe it's better to take approach of containers (the same interface and different modules)? The lazy and strict State monads differ only in their = operator. Since you don't have

Re: [Haskell-cafe] Current uses of Haskell in industry?

2012-06-14 Thread Roman Cheplyaka
* Chris Smith cdsm...@gmail.com [2012-06-13 18:00:21-0600] It turns out I'm filling in for a cancelled speaker at a local open source user group, and doing a two-part talk, first on Haskell and then Snap. For the Haskell part, I'd like a list of current places the language is used in

Re: [Haskell-cafe] High memory usage with 1.4 Million records?

2012-06-08 Thread Roman Cheplyaka
* Andrew Myers asm...@gmail.com [2012-06-07 20:39:50-0400] I've written a small driver test program that just parses the CSV, finds the minimum value for a couple of the Float fields, and exits. In the process monitor the memory usage is 6.9G before the program exits. I've tried profiling

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-31 Thread Roman Cheplyaka
* Matthias Hörmann mhoerm...@gmail.com [2012-05-31 10:40:31+0200] I noticed there are still some other problems in the code. In particular it doesn't work as intended in cases like this one: parseTest (do; r1 - anyOf [Hello, Hallo, Foo, HallofFame]; r2 - string fbla; return (r1, r2))

Re: [Haskell-cafe] Troubles understanding Parsec Error Handling

2012-05-30 Thread Roman Cheplyaka
character beyond the result it could return) or 7 (first character that makes the string no prefix of any acceptable string) Thanks for reporting. This is a regression introduced by me in this patch: Sun Feb 20 18:24:22 EET 2011 Roman Cheplyaka r...@ro-che.info * Choose the longest match when

Re: [Haskell-cafe] Building pattern and trying monads

2012-05-28 Thread Roman Cheplyaka
* Yves Parès yves.pa...@gmail.com [2012-05-28 11:28:22+0200] observe $ flip runStateT 10 $ (put 0 mzero) | modify (+3) ((),13) If the only thing you need is backtracking, using LogicT might be a little overkill, using Maybe in the bottom of you monad stack suits just fine: case flip

Re: [Haskell-cafe] Building pattern and trying monads

2012-05-27 Thread Roman Cheplyaka
* L Corbijn aspergesoe...@gmail.com [2012-05-27 14:21:39+0200] The solution I've in mind depends on the stack being pure. When the monad stack is pure a rule can be applied, returning a maybe value (or having a MaybeT wrapper) and when returning Nothing (failed rule) reverting the stack to

[Haskell-cafe] ANNOUNCE: time-lens-0.1

2012-05-19 Thread Roman Cheplyaka
I'm happy to announce the first, experimental version of the time-lens library. http://hackage.haskell.org/package/time-lens https://github.com/feuerbach/time-lens Its goal is to simplify working with time and date data structures in Haskell by providing lens-based overloaded accessors for

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-06 Thread Roman Cheplyaka
It is not tail-recursive. * Yves Parès yves.pa...@gmail.com [2012-05-06 10:58:45+0200] I do not agree: the fib function is tail-recursive, any good C compiler is able to optimize away the calls and reduce it to a mere loop. At least that's what I learnt about tail recursion in C with GCC.

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-06 Thread Roman Cheplyaka
* Artur apeka1...@gmail.com [2012-05-06 11:41:58+0300] isn't it that particular Haskell code is outperforming C (22 seconds vs. 33), just because the author uses recursion in C? I surely love Haskell, and the way it's code is easy parallelized, but that example seams not fair. I think the

Re: [Haskell-cafe] Arithmetic expressions with GADTs: parsing

2012-05-02 Thread Roman Cheplyaka
* j.romi...@gmail.com j.romi...@gmail.com [2012-05-02 08:03:45-0300] Hello. In order to learn GADTs, I have written the attached program, which defines a type for arithmetic expressions using GADTs, a parser for them, and an evaluation function. But my parser does not typecheck. ghc-7.4.1

Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-26 Thread Roman Cheplyaka
This is also quite similar to what we have in SmallCheck: https://github.com/feuerbach/smallcheck/blob/master/Test/SmallCheck/Series.hs Not sure how to exploit this, though. * Sjoerd Visscher sjo...@w3future.com [2012-04-26 00:32:28+0200] I am pleased to announce the 5th version of the

Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-26 Thread Roman Cheplyaka
* Tillmann Rendel ren...@informatik.uni-marburg.de [2012-04-26 21:34:21+0200] Hi, Sjoerd Visscher wrote: Just as there's a Foldable class, there should also be an Unfoldable class. This package provides one: class Unfoldable t where unfold :: Unfolder f = f a - f (t a) Just

Re: [Haskell-cafe] ANNOUNCE: fast-tags-0.0.1

2012-04-01 Thread Roman Cheplyaka
* Evan Laforge qdun...@gmail.com [2012-03-31 15:23:48-0700] A while back I was complaining about the profusion of poorly documented tags generators. Well, there is still a profusion of poorly documented tags generators... I was able to find 5 of them. So, that said, here's my contribution

Re: [Haskell-cafe] get a string representation (show) of a function argument

2012-03-31 Thread Roman Cheplyaka
* TP paratribulati...@free.fr [2012-04-01 00:29:15+0200] I am wondering if there is any means to get f 3 5 instead of 8 in the output of this program. No, this is not possible by referential transparency. The output of your function can't depend on whether it is passed 8 or the result of f 3

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Roman Cheplyaka
* Ting Lei tin...@hotmail.com [2012-03-26 11:33:16-0700] I was writing a code trying to use MonadPlus to detect some error cases (representing missing values etc. in pure code). You are probably looking for the MonadError class. There's also the MonadLogic class (which allows to literally

Re: [Haskell-cafe] Type classes for converting to Text and String

2012-03-08 Thread Roman Cheplyaka
* Simon Hengel s...@typeful.net [2012-03-08 10:53:15+0100] When writing library code that should work with both String and Text I find my self repeatedly introducing classes like: [...] How do you guys deal with that? Any thoughts? If it's fine to depend on FunDeps, you can use ListLike.

Re: [Haskell-cafe] Type classes for converting to Text and String

2012-03-08 Thread Roman Cheplyaka
* Simon Hengel s...@typeful.net [2012-03-08 11:48:41+0100] On Thu, Mar 08, 2012 at 12:18:56PM +0200, Roman Cheplyaka wrote: If it's fine to depend on FunDeps, you can use ListLike. http://hackage.haskell.org/package/ListLike How would that help with toText? toText = fromListLike

Re: [Haskell-cafe] Type classes for converting to Text and String

2012-03-08 Thread Roman Cheplyaka
* Simon Hengel s...@typeful.net [2012-03-08 13:20:22+0100] On Thu, Mar 08, 2012 at 12:54:13PM +0200, Roman Cheplyaka wrote: * Simon Hengel s...@typeful.net [2012-03-08 11:48:41+0100] On Thu, Mar 08, 2012 at 12:18:56PM +0200, Roman Cheplyaka wrote: If it's fine to depend on FunDeps, you

Re: [Haskell-cafe] Impact of try on Parsec performance

2012-03-03 Thread Roman Cheplyaka
* Omari Norman om...@smileystation.com [2012-03-02 23:30:22-0500] The Parsec documentation says that Parsec performs best on predictive grammars, and Parsec does not backtrack by default to improve performance (though this also improves error messages). On the other hand, I notice that

[Haskell-cafe] Monad laws in presence of bottoms

2012-02-20 Thread Roman Cheplyaka
I just realised that many common monads do not obey the monad laws when it comes to bottoms. E.g. for the Reader monad: undefined = return /= undefined return () = undefined /= undefined return () = const undefined /= undefined return undefined = \x - case x of () - return () /=

Re: [Haskell-cafe] Monad laws in presence of bottoms

2012-02-20 Thread Roman Cheplyaka
* Sebastian Fischer fisc...@nii.ac.jp [2012-02-21 00:28:13+0100] On Mon, Feb 20, 2012 at 7:42 PM, Roman Cheplyaka r...@ro-che.info wrote: Is there any other interpretation in which the Reader monad obeys the laws? If selective strictness (the seq combinator) would exclude function

Re: [Haskell-cafe] types and number of evaluation steps

2012-02-18 Thread Roman Cheplyaka
* Holger Siegel holgersiege...@yahoo.de [2012-02-18 12:52:08+0100] You cannot. Common subexpression elimination is done by GHC very conservatively, because it can not only affect impure programs: it can also affects strictness/lazyness and worsen memory usage of pure code. Like the HaskellWiki

Re: [Haskell-cafe] types and number of evaluation steps

2012-02-18 Thread Roman Cheplyaka
-18 18:23:19+0400] example = a + b + a + b exampleCSE = x + x where x = a + b With CSE we are introducing new thunk: x. 18.02.2012 17:38, Roman Cheplyaka пишет: * Holger Siegelholgersiege...@yahoo.de [2012-02-18 12:52:08+0100] You cannot. Common subexpression elimination is done

Re: [Haskell-cafe] ANN: unification-fd 0.6.0

2012-02-17 Thread Roman Cheplyaka
* wren ng thornton w...@freegeek.org [2012-02-17 13:05:58-0500] An effort has been made to try to make this package as portable as possible. That's a noble goal for libraries! However, because it uses the ST monad and the mtl-2 package it can't be H98 nor H2010. However, it only uses the

Re: [Haskell-cafe] Poll: Have you heard of or used GHC External Core?

2012-02-13 Thread Roman Cheplyaka
* James Fisher jameshfis...@gmail.com [2012-02-13 21:24:26+] On Mon, Feb 13, 2012 at 9:01 PM, Jason Dagit dag...@gmail.com wrote: Is this the same or different than what you get with the -fext-core command? The very same. Oh. I usually use -ddump-simpl. Are they different for the

Re: via-C

2012-02-06 Thread Roman Cheplyaka
* Serge D. Mechveliani mech...@botik.ru [2012-02-06 10:05:14+0400] I need a reliable portability for ages for the Haskell applications written in Haskell-2010 + Ext, where Ext = Overlapping instances + Multiparametric classes (as in GHC). In particular, my DoCon is such an application.

Re: [Haskell-cafe] Rewrite this imperative in FP way

2012-02-05 Thread Roman Cheplyaka
* Haisheng Wu fre...@gmail.com [2012-02-05 14:28:10+0800] a = [1,1,1,1] b = [0,1,2,3] d = [0,0,0,0] for i in b: for j in c: if (i+j)3: d[i+j] += a[i] Do you have any cool solution in FP way? You can use IntMap as a replacement for arrays: (I didn't understand your

Re: [Haskell-cafe] how to print out intermediate results in a recursive function?

2012-02-04 Thread Roman Cheplyaka
* Steve Horne sh006d3...@blueyonder.co.uk [2012-02-04 11:54:44+] On 04/02/2012 08:46, MigMit wrote: Well, if you want that in production, not for debugging purposes, you should change the type signature of mergesort so that it uses some monad. Printing requires IO monad; however, I would

Re: [Haskell-cafe] ANN: combinatorics

2012-01-30 Thread Roman Cheplyaka
* wren ng thornton w...@freegeek.org [2012-01-29 17:30:34-0500] On 1/29/12 5:48 AM, Roman Cheplyaka wrote: * wren ng thorntonw...@freegeek.org [2012-01-28 23:06:08-0500] * Math.Combinatorics.Primes: provides the prime numbers via Runciman's lazy wheel sieve algorithm. Provided here since

Re: [Haskell-cafe] ANN: combinatorics

2012-01-29 Thread Roman Cheplyaka
* wren ng thornton w...@freegeek.org [2012-01-28 23:06:08-0500] * Math.Combinatorics.Primes: provides the prime numbers via Runciman's lazy wheel sieve algorithm. Provided here since efficient algorithms for combinatorial functions often require prime numbers. The current version memoizes the

Re: [Haskell-cafe] Named captures in regex-pcre?

2012-01-28 Thread Roman Cheplyaka
* Ilya Portnov port...@iportnov.ru [2012-01-29 01:26:29+0500] Hi haskell-cafe. Is there a way to get named captures from regex using regex-pcre (or maybe other PCRE-package)? For example, I want to write something like let result = ab 12 cd =~ ab (?Pnumber\d+) cd :: SomeCrypticType and

Re: [Haskell-cafe] Data newtype differences. Today: strictness

2012-01-22 Thread Roman Cheplyaka
* Yves Parès yves.pa...@gmail.com [2012-01-22 11:32:30+0100] These make me think that pattern matching against a newtype is always lazy (irrefutable). Am I right? Yes. Is there some litterature expliciting in a less empiric way than I did the differences like this between data and newtype?

Re: [Haskell-cafe] Data newtype differences. Today: strictness

2012-01-22 Thread Roman Cheplyaka
* Yves Parès yves.pa...@gmail.com [2012-01-22 15:23:51+0100] Big sum up of everything: If TestN is a newtype constructor, then 'TestN undefined' and 'undefined' are exactly the same thing. To be precise, the former is a type-restricted version of the latter. -- Roman I. Cheplyaka ::

[Haskell-cafe] uu-parsinglib

2012-01-21 Thread Roman Cheplyaka
* S D Swierstra doai...@uu.nl [2012-01-20 16:32:00+0100] Thus far i have only happy users, and if you are having any problems please let me know. Hi Doaitse, One thing that I'm curious about is how you avoid combinatorial explosion when parsing in a breadth-first fashion. Do you somehow manage

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* Victor S. Miller victorsmil...@gmail.com [2012-01-21 12:29:32-0500] The do notation translates do {x - a;f} into a=(\x - f) However when we're working in the IO monad the semantics we want requires that the lambda expression be strict in its argument. I'm not aware of any semantics

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* David Barbour dmbarb...@gmail.com [2012-01-21 10:01:00-0800] As noted, IO is not strict in the value x, only in the operation that generates x. However, should you desire strictness in a generic way, it would be trivial to model a transformer monad to provide it. Again, that wouldn't be a

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* David Barbour dmbarb...@gmail.com [2012-01-21 11:02:40-0800] On Sat, Jan 21, 2012 at 10:51 AM, David Menendez d...@zednenem.com wrote: The Eval monad has the property: return undefined = const e = e. You can't write `const e` in the Eval monad. Why not? ghci runEval $ return

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* David Barbour dmbarb...@gmail.com [2012-01-21 11:09:43-0800] Logically only has meaning when `=` applies to values in the domain. `undefined` is not a value in the domain. We can define monads - which meet monad laws - even in strict languages. In strict languages 'undefined' is not a

Re: [Haskell-cafe] Fwd: Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* David Barbour dmbarb...@gmail.com [2012-01-21 12:18:09-0800] `undefined` is not a value in any domain. It isn't a value at all. It's certainly not part of my monad language or algebra. Up to the semantic level of comparing observable and legally defined behaviors, we can have the identity

Profiling semantics

2012-01-17 Thread Roman Cheplyaka
* Simon Marlow marlo...@gmail.com [2012-01-03 11:00:58+] I'd be interested in hearing feedback, particularly if you find a case where costs are attributed somewhere that you didn't expect, or the stack looks wrong. What I often find counter-intuitive is how the 'entries' count is computed.

Re: Profiling semantics

2012-01-17 Thread Roman Cheplyaka
* Simon Marlow marlo...@gmail.com [2012-01-17 09:44:22+] On 17/01/2012 09:30, Roman Cheplyaka wrote: * Simon Marlowmarlo...@gmail.com [2012-01-03 11:00:58+] I'd be interested in hearing feedback, particularly if you find a case where costs are attributed somewhere that you didn't

Re: [Haskell-cafe] Are all monads functions?

2011-12-31 Thread Roman Cheplyaka
* Yves Parès limestrael+hask...@gmail.com [2011-12-31 13:09:37+0100] One thought occur to me recently when explaining the concept of Monad to non-haskellers: internally, all standard Monads are newtypes wrapping functions: StateT is, WriterT is, ContT is. Even IO and ST are, both conceptually

Re: ANNOUNCE: GHC 7.4.1 Release Candidate 1

2011-12-21 Thread Roman Cheplyaka
* Ian Lynagh ig...@earth.li [2011-12-21 18:29:21+] * The profiling and hpc implementations have been merged and overhauled. Visible changes include renaming of profiling flags: http://www.haskell.org/ghc/dist/stable/docs/html/users_guide/flag-reference.html#id589412 and

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-19 Thread Roman Cheplyaka
* Alexander Solla alex.so...@gmail.com [2011-12-19 19:10:32-0800] * Documentation that discourages thinking about bottom as a 'value'. It's not a value, and that is what defines it. In denotational semantics, every well-formed term in the language must have a value. So, what is a value of fix

[Haskell] ANNOUNCE: smallcheck-0.6; test-framework-smallcheck-0.1

2011-12-11 Thread Roman Cheplyaka
I'm pleased to announce a new release of SmallCheck. The highlights for this release are: * Default Generic implementation of Serial instance, contributed by Bas van Dijk This means that you don't need to write instances by hand for your types to generate test values for them. See [1]

Re: [Haskell-cafe] [ANNOUNCEMENT] xmobar 0.14

2011-12-11 Thread Roman Cheplyaka
* Jose A. Ortega Ruiz j...@gnu.org [2011-12-11 08:43:01+0100] On Sun, Dec 11 2011, Brandon Allbery wrote: [...] xmobar currently requires parsec 3.x; the above is the symptom of building it against 2.x. Aha, thanks for pointing this out, guys. Peter, would using parsec 3.x be an

[Haskell-cafe] ANNOUNCE: smallcheck-0.6; test-framework-smallcheck-0.1

2011-12-11 Thread Roman Cheplyaka
I'm pleased to announce a new release of SmallCheck. The highlights for this release are: * Default Generic implementation of Serial instance, contributed by Bas van Dijk This means that you don't need to write instances by hand for your types to generate test values for them. See [1]

Re: [Haskell-cafe] Complete package description list

2011-12-06 Thread Roman Cheplyaka
* Paterson, Ross r.pater...@city.ac.uk [2011-12-06 09:09:36+] Shakthi Kannan writes: So, how would I know if there is a new package in it, other than having to compare it to the previous snapshot? Does the filename (00-index.tar.gz) change? The filename doesn't change. You could use

[Haskell-cafe] ANNOUNCE: SmallCheck 0.5

2011-11-19 Thread Roman Cheplyaka
Following the recent discussion on Haskell-Cafe, I've taken over maintainership of SmallCheck. This is to announce a new minor release, SmallCheck 0.5. It fixes build on GHC 7.2 and makes a few cosmetic changes. http://hackage.haskell.org/package/smallcheck-0.5 In the future there will be

Re: [Haskell-cafe] Superset of Haddock and Markdown

2011-11-18 Thread Roman Cheplyaka
* Johan Tibell johan.tib...@gmail.com [2011-11-17 21:09:15-0800] Hi all, I spent some time today documenting a library and the experience left me wanting a better markup language. In particular, Haddock lacks: * markup for bold text: bold text works better than italics for emphasis on

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Roman Cheplyaka
* Johan Tibell johan.tib...@gmail.com [2011-11-17 21:21:47-0800] Hi all, Data.Map is getting split into Data.Map.Lazy and Data.Map.Strict (with Data.Map re-exporting the lazy API). I want to better document the strictness properties of the two new modules. Right now the documentation for

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Roman Cheplyaka
* Johan Tibell johan.tib...@gmail.com [2011-11-18 08:06:29-0800] On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka r...@ro-che.info wrote: Is it mentioned anywhere that Map is spine-strict? It's not and we should probably mention it. Hm. Perhaps I'm missing something, but data Map k

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Roman Cheplyaka
* Brandon Allbery allber...@gmail.com [2011-11-18 12:20:33-0500] On Fri, Nov 18, 2011 at 12:16, Roman Cheplyaka r...@ro-che.info wrote: * Johan Tibell johan.tib...@gmail.com [2011-11-18 08:06:29-0800] On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka r...@ro-che.info wrote

Re: [Haskell-cafe] ST not strict enough?

2011-11-15 Thread Roman Cheplyaka
* Jason Dusek jason.du...@gmail.com [2011-11-15 20:08:48+] I'm having some trouble with memory usage in rebuilding a ByteString with some sequences escaped. I thought I'd try vectors. However, it seems that even a relatively simple function, one that places all the bytes of a ByteString in

[Haskell-cafe] Is SmallCheck maintained?

2011-11-14 Thread Roman Cheplyaka
Hi Cafe, Does anyone currently work on Test.SmallCheck? I see the following problems: 1. SC doesn't have a repository, issue tracker etc. 2. It is not integrated with popular test frameworks 3. API should be better documented I'm willing to work on the above problems, but wanted to check first

Re: foldr oddity

2011-10-12 Thread Roman Cheplyaka
* Daniel Peebles pumpkin...@gmail.com [2011-10-11 23:18:15-0400] Yeah, you should absolutely mind the order of the parameters (or more generally, when the operation isn't commutative), the strictness of the function's second parameter. In this case, both () and (||) are strict in their first

Re: foldr oddity

2011-10-12 Thread Roman Cheplyaka
* Frodo Chao frodogr...@gmail.com [2011-10-12 10:45:04+0800] Hi, I came upon this when playing with foldr and filter. Compare the two definitions: testr n = foldr (\x y - x y) True [t | (_, t) - zip [1 .. n] [True, True ..]] testr' n = foldr (\x y - y x) True [t | (_, t) - zip [1 ..

Re: Unwanted eta-expansion

2011-10-12 Thread Roman Cheplyaka
-haskell-users- | boun...@haskell.org] On Behalf Of Jan-Willem Maessen | Sent: 10 October 2011 02:51 | To: Roman Cheplyaka | Cc: glasgow-haskell-users@haskell.org | Subject: Re: Unwanted eta-expansion | | On Sun, Oct 9, 2011 at 10:54 AM, Roman Cheplyaka r...@ro-che.info wrote: | * Jan-Willem

Re: case of an empty type should have no branches

2011-10-11 Thread Roman Cheplyaka
* John Meacham j...@repetae.net [2011-10-10 19:56:59-0700] What are you trying to acomplish? A case doesn't necessarily force evaluation in haskell depending on the binding pattern. for instance case x of _ - undefined will parse, but the function is still lazy in x. it is exactly equivalant

Unwanted eta-expansion

2011-10-04 Thread Roman Cheplyaka
Suppose I want a foldl which is evaluated many times on the same list but with different folding functions. I would write something like this, to perform pattern-matching on the list only once: module F where myFoldl :: [a] - (b - a - b) - b - b myFoldl [] = \f a - a myFoldl

Re: [Haskell-cafe] ANN: Peggy 0.2.1

2011-10-01 Thread Roman Cheplyaka
* Hideyuki Tanaka tan...@preferred.jp [2011-09-29 04:53:59+0900] Hello, all. I have released 'Peggy' a new parser generator . It is based on Parsing Expression Grammer (PEG) [1], and generates efficient packrat parsers. How does it compare to frisby?

Re: [Haskell-cafe] Parsec line number off-by-one

2011-09-21 Thread Roman Cheplyaka
list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Roman I. Cheplyaka :: http://ro-che.info/ 4 patches for repository http://code.haskell.org/parsec3: Sun Feb 20 18:24:22 EET 2011 Roman Cheplyaka r...@ro-che.info * Choose the longest match when merging

Re: [Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-18 Thread Roman Cheplyaka
* Anton Tayanovskyy anton.tayanovs...@gmail.com [2011-09-17 21:46:57-0400] So you want to encode priorities efficiently as far as I understand from [1]? Could bit-packing combined with prefix elimination do the trick? Choice boils down to binary choice. Attach a number N to every execution

Re: [Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-18 Thread Roman Cheplyaka
* Anton Tayanovskyy anton.tayanovs...@gmail.com [2011-09-17 22:11:00-0400] By the way, can Haskell have a type that admits regular expression and only those? I mostly do ML these days, so trying to write up a regex types in Haskell I was unpleasantly surprised to discover that there are all

Re: [Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-18 Thread Roman Cheplyaka
Chris, Thank you for an interesting overview. However, I'm not worried directly about DoS. I just want to build a regex library which would be convenient to use for parsing regular languages (by providing applicative interface and Perl semantics), and not worse than alternatives performance-wise

Re: [Haskell-cafe] The applicative instances for Either?

2011-09-17 Thread Roman Cheplyaka
A natural reference would be the darcs repository http://darcs.haskell.org/packages/base/ or its git mirror http://darcs.haskell.org/packages/base.git which I used because getting it is much faster. Using 'git blame Control/Applicative.hs' I figured out that the instance was added in this

Re: [Haskell-cafe] VirtuaHac - online Haskell hacathon

2011-09-16 Thread Roman Cheplyaka
* Chris Smith cdsm...@gmail.com [2011-09-16 12:13:13-0600] Overview VirtuaHac is a Haskell hacathon being planned using Google+ and a Wiki. The rules will be that if you have a project you'd like to participate in, then: 1. Create a darcs or git repository. 2. Post a Hangout in

Re: [Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-14 Thread Roman Cheplyaka
* Eugene Kirpichov ekirpic...@gmail.com [2011-09-14 08:38:10+0400] Hi, I don't see how fallback to NFA simulation is really a failure wrt DoS attacks. It's not exponential in time or memory, just linear memory (in size of regex) instead of constant, and slower than DFA. Hi Eugene, thanks for

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Roman Cheplyaka
* Kazu Yamamoto k...@iij.ad.jp [2011-09-14 15:59:05+0900] Hello, My friend reached the following version: chop :: String - String chop = foldr go [] where go x xs | isSpace x null xs = [] | otherwise= x:xs This version is faster than the reverse

Re: [Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-13 Thread Roman Cheplyaka
* Chris Kuklewicz hask...@list.mightyreason.com [2011-09-13 08:21:55+0100] I wrote regex-tdfa, the efficient (though not yet lightning fast) Posix-like engine. You are not the first to want an efficient Perl-like engine. The answer you seek flows from Russ Cox (though in C++):

Re: [Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-13 Thread Roman Cheplyaka
* Roman Cheplyaka r...@ro-che.info [2011-09-14 00:29:55+0300] Then there's another issue: I specifically want a combinator library, and not every automaton-based algorithm can serve this purpose in a statically typed language (unless there's some clever trick I don't know). Just to clarify

[Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-12 Thread Roman Cheplyaka
Please help make the regex-based parsing library efficient! https://github.com/feuerbach/regex-applicative/wiki/Call-For-Help -- Roman I. Cheplyaka :: http://ro-che.info/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] mapM is supralinear?

2011-09-08 Thread Roman Cheplyaka
* Ertugrul Soeylemez e...@ertes.de [2011-09-07 16:20:03+0200] In general it's a bad idea to use mapM over IO. Could you explain why? Thanks. -- Roman I. Cheplyaka :: http://ro-che.info/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Idiomatic usage of the fixpoint library

2011-09-04 Thread Roman Cheplyaka
Hi, I'm looking for an example of idiomatic usage of the fixpoint library[1]. [1]: http://hackage.haskell.org/package/fixpoint-0.1.1 Here's what I managed to get: {-# LANGUAGE TypeFamilies, FlexibleContexts, UndecidableInstances, FlexibleInstances #-} import Data.Fixpoint newtype

Re: [Haskell-cafe] Idiomatic usage of the fixpoint library

2011-09-04 Thread Roman Cheplyaka
* Sean Leather leat...@cs.uu.nl [2011-09-04 12:48:38+0200] On Sun, Sep 4, 2011 at 12:31, Roman Cheplyaka wrote: I'm looking for an example of idiomatic usage of the fixpoint library[1]. [1]: http://hackage.haskell.org/package/fixpoint-0.1.1 I'm not sure if this counts for idiomatic

Re: [Haskell-cafe] Function returning the type of its argument.

2011-07-29 Thread Roman Cheplyaka
* Grigory Sarnitskiy sargrig...@ya.ru [2011-07-29 21:54:05+0400] It is not possible in Haskell, moreover it seems to be too alien to Haskell. Nevertheless, is there an extension which would allow to write a function that returns the type of its argument? Sounds like you want typeOf.

Why no stack overflow in ghci?

2011-07-26 Thread Roman Cheplyaka
The code main = print $ foldl (+) 0 [1..100] when compiled (without optimizations) results in a stack overflow, which is expected. However, when run from ghci it succeeds. Why is it so? (Tested with GHC 6.12.something and 7.0.4) Is it related to stack-squeezing? I couldn't find any

Re: [Haskell-cafe] Diagnose stack space overflow

2011-07-04 Thread Roman Cheplyaka
Hi Don, I find this answer confusing. The SO question you're linking to is about heap size, not stack overflow. The stack size in this example is 8M. The whole heap size may be much bigger (and increasing the stack size may actually remove the overflow). It would be interesting to learn about

[Haskell] ANNOUNCE: regex-applicative-0.1

2011-07-03 Thread Roman Cheplyaka
I am glad to announce the initial release of regex-applicative. Hackage: http://hackage.haskell.org/package/regex-applicative Repository: https://github.com/feuerbach/regex-applicative Issues: https://github.com/feuerbach/regex-applicative/issues regex-applicative is aimed to be an

[Haskell-cafe] ANNOUNCE: regex-applicative-0.1

2011-07-03 Thread Roman Cheplyaka
I am glad to announce the initial release of regex-applicative. Hackage: http://hackage.haskell.org/package/regex-applicative Repository: https://github.com/feuerbach/regex-applicative Issues: https://github.com/feuerbach/regex-applicative/issues regex-applicative is aimed to be an

Re: [Haskell-cafe] Comment Syntax

2011-06-04 Thread Roman Cheplyaka
* Andrew Coppin andrewcop...@btinternet.com [2011-06-03 18:12:04+0100] On 03/06/2011 05:02 PM, Albert Y. C. Lai wrote: I propose that only {- -} is comment; that is, -- is an operator token and not a marker of comments. I'm curious to know why anybody thought that -- was a good comment

[Haskell-cafe] Is fusion overrated?

2011-05-17 Thread Roman Cheplyaka
If one thinks about Haskell data structures as of ordinary data structures, fusion seems a great deal -- instead of producing intermediate lists and possibly running out of memory, we just run a loop and use constant amount of space. But Haskell data structures are quite different -- they are

Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-10 Thread Roman Cheplyaka
* Eric Rasmussen ericrasmus...@gmail.com [2011-05-09 15:07:57-0700] Hi everyone, I am relatively new to Haskell and Parsec, and I couldn't find any articles on parsing numbers in the following format: You could read hledger[1] sources for inspiration: it's written in Haskell and contains

Re: [Haskell-cafe] Apache license, any drawbacks for Haskell packages?

2011-05-09 Thread Roman Cheplyaka
* Jason Dagit dag...@gmail.com [2011-05-09 01:59:46-0700] On Sun, May 8, 2011 at 1:25 PM, Magnus Therning mag...@therning.org wrote: Are there any drawbacks to using the Apache license for Haskell packages? I don't think so. It looks to be almost identical to using BSD3, which is

Re: [Haskell-cafe] ANN: bash-0.0.0

2011-03-06 Thread Roman Cheplyaka
* Ivan Lazar Miljenovic ivan.miljeno...@gmail.com [2011-03-06 15:27:50+1100] On 6 March 2011 14:57, Jason Dusek jason.du...@gmail.com wrote:  Many-a-time, have I used higher level languages to generate  Bash scripts. Here, for the first time, I have taken the time  to write a structured and

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-21 Thread Roman Cheplyaka
* Max Bolingbroke batterseapo...@hotmail.com [2011-02-21 14:57:08+] On 20 February 2011 03:40, Louis Wasserman wasserman.lo...@gmail.com wrote: I'd like to complain about that, too ;) I'm curious, when do people find that they need a really fast way to get map size? I use them quite a

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-19 Thread Roman Cheplyaka
Hi Johan, this work is highly appreciated, thanks! * Johan Tibell johan.tib...@gmail.com [2011-02-18 17:38:51-0800] Hi all, I am delighted to announce the release of preview versions of two new packages: unordered-containers 0.1 Efficient hashing-based container types.

Re: [Haskell-cafe] Unrecognized function symbols in .prof

2011-02-08 Thread Roman Cheplyaka
* Iavor Diatchki iavor.diatc...@gmail.com [2011-02-07 23:45:58-0800] Another option would be to look at the generated core by using -ddump-simpl when compiling. This will generate a whole bunch of output, which you can redirect to a file and the search for the mysterious symbols inside. IIRC

Re: [Haskell-cafe] community server hasktags learned recursing into directories

2011-02-05 Thread Roman Cheplyaka
* Marc Weber marco-owe...@gmx.de [2011-02-04 22:35:53+] hasktags learned about how to recurse into subdirectories itself. This is especially useful for windows because writing scripts can be done but is less well known (http://stackoverflow.com/questions/4865391/answer/submit) Thanks

Re: [Haskell-cafe] Status update on {code, trac, projects, planet, community}.haskell.org

2011-02-03 Thread Roman Cheplyaka
* Duncan Coutts duncan.cou...@googlemail.com [2011-02-02 01:33:22+] These are all hosted on the community server. The community server was hacked on the 26th January and we took it offline. The server was running an old version of debian that was no longer supported with security updates.

Re: [Haskell-cafe] Another Question

2011-02-03 Thread Roman Cheplyaka
Hi Navin, next time, could you please choose more informative subject for your emails to the mailing list? It is read by many people, and choosing a good subject will save them a lot of time. In this case, something like Stack overflow or How to make a function strict would do. Thanks. --

Bug in undecidable instances?

2011-01-31 Thread Roman Cheplyaka
The following looks like a bug in (undecidable) instances resolution. {-# LANGUAGE MultiParamTypeClasses,FlexibleInstances,UndecidableInstances, OverlappingInstances,IncoherentInstances #-} class C a b instance C a (a,b) class D a b instance (D a b, C b c)

Re: [Haskell-cafe] [Haskell] ANNOUNCE: jhc 0.7.7 is out.

2011-01-30 Thread Roman Cheplyaka
Greetings! A few questions about the inclusion of parsec: 1. It is parsec-2, not parsec-3, right? 2. Does this change consist of merely inclusion parsec as a standard library, or are there any compiler improvements in this release that made it possible to build parsec? * John Meacham

<    1   2   3   4   5   6   >