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

2013-06-16 Thread Niklas Hambüchen
give it another try. Niklas On 17/06/13 02:42, Albert Y. C. Lai wrote: > 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-r

[Haskell-cafe] ordNub

2013-07-14 Thread Niklas Hambüchen
tldr: nub is abnormally slow, we shouldn't use it, but we do. As you might know, Data.List.nub is O(n²). (*) As you might not know, almost *all* practical Haskell projects use it, and that in places where an Ord instance is given, e.g. happy, Xmonad, ghc-mod, Agda, darcs, QuickCheck, yesod, shak

Re: [Haskell-cafe] ordNub

2013-07-14 Thread Niklas Hambüchen
One of my main points is: Should we not add such a function (ord-based, same output as nub, stable, no sorting) to base? As the package counting shows, if we don't offer an alternative, people obviously use it, and not to our benefit. (Not to say it this way: We could make the Haskell world fa

Re: [Haskell-cafe] ordNub

2013-07-15 Thread Niklas Hambüchen
Hey Jason, would you mind giving a short idea of what the point of Bird's implementation is / from what properties it is derived? Also, running the QuickCheck tests you added, it doesn't give the same output (order) as nub. On 15/07/13 13:26, Jason Dagit wrote: > Richard Bird has a book, "Pearls

Re: [Haskell-cafe] Hoogle problems?

2013-07-15 Thread Niklas Hambüchen
OK, but why does it need to go down for migration? On Mon 15 Jul 2013 23:52:02 SGT, Daniel F wrote: > The web site is migrating. > IRC says: Topic for #haskell: haskell.org in the middle of migration; > expect turbulence; use www.haskell.org ___ Haske

Re: [Haskell-cafe] Monad Transformer Space Leak

2013-07-18 Thread Niklas Hambüchen
Did you file this as a bug? On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote: > I'm on 7.6.2, and it does. Oh no. > > - Clark > > On Tuesday, April 23, 2013, Tom Ellis wrote: > > On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote: > > I tested it on GHC 6.12.1, which wasn't a

Re: [Haskell-cafe] Monad Transformer Space Leak

2013-07-18 Thread Niklas Hambüchen
Sounds like a Real Good Thing to do :) On Fri 19 Jul 2013 11:10:25 JST, Clark Gaebel wrote: > No I haven't. > > - Clark > > On Thu, Jul 18, 2013 at 10:07 PM, Niklas Hambüchen wrote: >> Did you file this as a bug? >> >> On Tue 23 Apr 2013 23:16:03 JST, Cla

Re: [Haskell-cafe] casting a into Maybe a

2013-07-27 Thread Niklas Hambüchen
Put a Just around it? transMit s now key (Just newmsgs) q m On Sat 27 Jul 2013 20:05:43 JST, Joerg Fritsch wrote: > If I have the following type signature > transMit :: Serialize a => Socket -> POSIXTime -> KEY -> Maybe a -> TPSQ -> > TMap a -> IO () > > > And the function is called with > trans

Re: [Haskell-cafe] Renumbered mailing list posts

2013-08-10 Thread Niklas Hambüchen
Yes, I also found that links from Google to archives don't work any more. (Also fact that hpaste just went away, invalidating all my links to hpastes, is similarly bad.) On Sat 10 Aug 2013 17:49:35 JST, Henning Thielemann wrote: > Recently I found that links from Google search results to archiv

Re: [Haskell-cafe] Renumbered mailing list posts

2013-08-10 Thread Niklas Hambüchen
On 11/08/13 00:50, Brandon Allbery wrote: > Those at least are recoverable, just replace hpaste.org > with lpaste.net (content is > still there). But still. Unfortunately I cannot amend emails that I have sent. Could we not just have kept the domain and set

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

2013-08-20 Thread Niklas Hambüchen
Nice! I hope that haskell-suite will eventually become awesome and solve most of our automation-on-Haskell-code needs. Two questions: 1) My most desired feature would be a syntax tree that does not pluck pluck comments out and make me treat them separately. It looks much easier to me to have a f

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

2013-08-20 Thread Niklas Hambüchen
On 20/08/13 18:19, Niklas Broberg wrote: > Sadly not - it's theoretically impossible. The fact that you can put > comments literally wherever, means that it's impossible to treat them as > nodes of the AST. E.g. > > f {- WHERE -} x = -- WOULD > -- THESE > do -- COMMENTS > a

[Haskell-cafe] ANNOUNCE: posix-paths, for faster file system operations

2013-08-20 Thread Niklas Hambüchen
John Lato and I would like to announce our posix-paths package. https://github.com/JohnLato/posix-paths It implements a large portion of System.Posix.FilePath using ByteString based RawFilePaths instead of String based FilePaths, and on top of that provides a Traversal module with a fast repl

Re: [Haskell-cafe] Renumbered mailing list posts

2013-08-25 Thread Niklas Hambüchen
Austin: Do you have any update on this? On 11/08/13 04:48, Austin Seipp wrote: > Henning, > > Thanks for the report. I'm currently investigating this, and think it > should be possible to keep all of the old URLs intact. > > On Sat, Aug 10, 2013 at 11:01 AM, Niklas Hambüc

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

2013-08-26 Thread Niklas Hambüchen
On #haskell we recently had a discussion about the following: import System.Random list <- replicateM 100 randomIO :: IO [Int] I would think that this gives us a list of a million random Ints. In fact, this is what happens in ghci. But with ghc we get: Stack space overflow: current

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

2013-08-26 Thread Niklas Hambüchen
As an example that this actually makes problems in production code, I found this in the wildlife: https://github.com/ndmitchell/shake/blob/e0e0a43/Development/Shake/Database.hs#L394 -- Do not use a forM here as you use too much stack space bad <- (\f -> foldM f [] (Map.toList status)) $ \

Re: [Haskell-cafe] ordNub

2013-08-26 Thread Niklas Hambüchen
On 14/07/13 20:20, Niklas Hambüchen wrote: > As you might not know, almost *all* practical Haskell projects use it, > and that in places where an Ord instance is given, e.g. happy, Xmonad, > ghc-mod, Agda, darcs, QuickCheck, yesod, shake, Cabal, haddock, and 600 > more (see https://gi

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

2013-08-26 Thread Niklas Hambüchen
Maybe an unlimited stack size should be the default? As far as I understand, the only negative effect would be that some programming mistakes would not result in a stack overflow. However, I doubt the usefulness of that: * It already depends a lot on the optimisation level * If you do the same th

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

2013-08-26 Thread Niklas Hambüchen
Thanks for your examples. On 27/08/13 13:59, Albert Y. C. Lai wrote: > The correct fix is to raise the stack cap, not to avoid using the stack. > > Indeed, ghci raises the stack cap so high I still haven't fathomed where > it is. This is why you haven't seen a stack overflow in ghci for a long >

[Haskell-cafe] cpphs calls error when it finds an #error declaration

2013-08-27 Thread Niklas Hambüchen
Hi, after some debugging of a higher-level tool I found out that when I use cpphs as a library and the `runCpphs` function that is to produce the preprocessed output, when it comes across the #error directive it will terminate my program. This is because handling #error is implemented with Haskel

Re: [Haskell-cafe] Template Haskell

2013-08-27 Thread Niklas Hambüchen
Hi Jose, Template Haskell doesn't parse code. haskell-src-exts and the GHC API can do that. Have a look at: * ghc-mod browse (using ghc api) * hscope (using haskell-src-exts) On 27/08/13 15:45, Jose A. Lopes wrote: > Hi, > > Is it possible to retrieve all definitions contained in a module usi

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

2013-08-27 Thread Niklas Hambüchen
On 27/08/13 20:37, Patrick Palka wrote: > You can use ContT to force the function to use heap instead of stack > space, e.g. runContT (replicateM 100 (lift randomIO)) return That is interesting, and works. Unfortunately its pure existence will not fix sequence, mapM etc. in base. ___

Re: [Haskell-cafe] cpphs calls error when it finds an #error declaration

2013-08-28 Thread Niklas Hambüchen
On 29/08/13 00:43, Malcolm Wallace wrote: > Have you tried simply wrapping the call to runCpphs in a "catch"? Something > like > > safeRunCpphs :: ... -> IO (Either String String) > safeRunCpphs foo = fmap Right (runCpphs foo) `catch` (\(UserError s)-> > Left s Yes, that is what I'm do

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-08-31 Thread Niklas Hambüchen
Hello, I disagree. While none of your detail points are wrong, they mainly focus on the fact that there is no 1-to-1 mapping between the existing haddock markup and Markdown. I don't think there needs to be. If Markdown can do something new, that something can be added; if something doesn't make

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-09-01 Thread Niklas Hambüchen
On 01/09/13 04:27, Mateusz Kowalczyk wrote: > It doesn't have to be 1-to-1 but the features have to be expressible in > both: it's useless if we have different features with one syntax but not > the other. I don't find that useless. Markdown does not have definition lists, but we use a normal list

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-09-03 Thread Niklas Hambüchen
On 30/08/13 10:30, Mateusz Kowalczyk wrote: > I would also like to remind you that if there's something that you'd > like to see in Haddock or something that you feel is broken, a good way > express this is to make a ticket on the Haddock Trac[2]. I made one: http://trac.haskell.org/haddock/ticke

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Niklas Hambüchen
Hi, I'm also interested in that. Have you already evaluated haste? It does not seem to have any of your cons, but maybe others. What I particularly miss from all solutions is the ability to simply call parts written in Haskell from Javascript, e.g. to write `fib` and then integrate it into an

Re: [Haskell-cafe] GHC API + Cabal API + Cabal version checks: is there a way out?

2013-09-06 Thread Niklas Hambüchen
On Fri 06 Sep 2013 22:13:58 JST, Yuri de Wit wrote: > The right solution, imho, is to review these dependencies and move > the low level ones out into a separate package that is shared by both > ghc and cabal and that will rarely change. The direct side effect of > this is that ghc would not be tie

Re: [Haskell-cafe] GHC API + Cabal API + Cabal version checks: is there a way out?

2013-09-06 Thread Niklas Hambüchen
On Fri 06 Sep 2013 22:52:40 JST, Roman Cheplyaka wrote: > The right solution for Cabal would be not to know anything about the > GHC's database format at all. > > GHC and cabal communicate via a command line interface (`ghc-pkg dump` > in our direction; `ghc-pkg update` in the other). So it would s

Re: [Haskell-cafe] GHC API + Cabal API + Cabal version checks: is there a way out?

2013-09-06 Thread Niklas Hambüchen
It looks to me that technically it should be easy to split off the part required by GHC. Maybe somebody could just try that (currently it does not seem to take longer than a few hours) so that we have some basic proposal and momentum. On 07/09/13 00:04, JP Moresmau wrote: > Oh, I'm happy to help

Re: [Haskell-cafe] GHC API + Cabal API + Cabal version checks: is there a way out?

2013-09-06 Thread Niklas Hambüchen
We just had a short discussion on #ghc, I copy-paste: http://lpaste.net/92639 dcoutts_: nh2: Cabal does not depend on the ghc-pkg format. Cabal specifies a compiler-independent package registration format. GHC uses it in its external interface (and internally too). It uses the Cabal lib for the p

Re: [Haskell-cafe] GHC API + Cabal API + Cabal version checks: is there a way out?

2013-09-06 Thread Niklas Hambüchen
I have filed a GHC ticket under http://ghc.haskell.org/trac/ghc/ticket/8244 I hope this way we can find a solution soon. On 07/09/13 00:04, JP Moresmau wrote: > Oh, I'm happy to help as well if somebody is needed to do the change, > since I have much to win in the future if EclipseFP can take ad

Re: [Haskell-cafe] Strange IO sequence behaviour (Was: sequence causing stack overflow on pretty small lists)

2013-09-06 Thread Niklas Hambüchen
Ah, that's enlightening, and a good addition to http://ghc.haskell.org/trac/ghc/ticket/8189 On Sat 07 Sep 2013 04:31:31 JST, Tom Ellis wrote: > FYI, rwbarton on Reddit produced a nice answer: > > > http://www.reddit.com/r/haskell/comments/1luan1/strange_io_sequence_behaviour/cc32ec4 __

Re: [Haskell-cafe] GHC API + Cabal API + Cabal version checks: is there a way out?

2013-09-07 Thread Niklas Hambüchen
Would you mind hanging around in #ghc when working on it? A few people found this interesting, so this might be useful to avoid duplicate effort. On Sat 07 Sep 2013 18:24:43 JST, JP Moresmau wrote: > I'll be happy to give it a shot! ___ Haskell-Cafe

[Haskell-cafe] Proposal: New syntax for Haskell

2013-09-10 Thread Niklas Hambüchen
Impressed by the productivity of my Ruby-writing friends, I have recently come across Cucumber: http://cukes.info It is a great tool for specifying tests and programs in natural language, and especially easy to learn for beginners. I propose that we add a Cucumber syntax for Haskell, with the ex

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

2013-09-11 Thread Niklas Hambüchen
Looks pleasing! I have one feature request: Could you make headings links, or add anchors next to them (github readme style), such that I can directly share what I'm reading with people? On Wed 11 Sep 2013 20:31:30 JST, Obscaenvs wrote: > At [1] you can find links to the GHC documentation that

Re: [Haskell-cafe] FFI: how to handle external dll crashes

2013-09-23 Thread Niklas Hambüchen
If you cannot do it with Haskell exceptions, I guess you need to look how you would do it in plain C in do the same. Keep in mind that if something crashes in a C library, that library might have corrupted (or leaked) any memory it had access to. I guess a somewhat reliable way is to fork an OS

Re: [Haskell-cafe] FFI: how to handle external dll crashes

2013-09-23 Thread Niklas Hambüchen
Hey, I don't think any of your code actually forks of an *OS process*. There three main kinds of threading constructs: * Haskell threads (forkIO) * Operating System threads (forkOS) * Operating System processes (forkProcess, fork() in C) Async uses the first one, you will need last one (which i

Re: [Haskell-cafe] ordNub

2013-10-12 Thread Niklas Hambüchen
I would like to come back to the original question: How can ordNub be added to base? I guess we agree that Data.List is the right module for a function of type Ord a => [a] -> [a], but this introduces * a cyclic dependency between Data.List and Data.Set * a base dependency on containers. What i

Re: [Haskell-cafe] ordNub

2013-10-12 Thread Niklas Hambüchen
On 12/10/13 20:43, Anthony Cowley wrote: > I think nub's behavior is rather set-related, so I don't really understand > the objection to putting it in Data.Set. In sets, the order does not matter, while for nub it does. nub:: Eq a => [a] -> [a] ordNub :: Ord a => [a] -> [a] both do

Re: [Haskell-cafe] ordNub

2013-10-13 Thread Niklas Hambüchen
On 13/10/13 21:42, AntC wrote: >> Niklas Hambüchen nh2.me> writes: >> >> In sets, the order does not matter, while for nub it does. >> > > Let's be careful here!. Niklas, when you say "order", do you mean: > * the _ordering_ from the Ord instan

Re: [Haskell-cafe] ordNub

2013-10-13 Thread Niklas Hambüchen
On 14/10/13 03:20, AntC wrote: > Thanks Niklas, I hadn't spotted those benchmarks back in July. No worries :) > I'm surprised at that result for singletons > (and for very small numbers of elements which are in fact each different). I think one of the main reasons for the performance difference

[Haskell-cafe] createProcess running non-existent programs

2012-08-12 Thread Niklas Hambüchen
I just came across the fact that running createProcess (proc "asdfasdf" []) with non-existing command "asdfasdf" returns perfectly fine handles. I would expect an exception. You can even hGetContents on stdout: You just get "". I find this highly counter-intuitive. Is this intended? Thanks

[Haskell-cafe] Custom QuickCheck Gens without custom shrinks

2012-08-15 Thread Niklas Hambüchen
I wrote this Gen to generate lines of texts without \NUL and \n: fullLinesProp = forAll linesGen ... linesGen = listOf . listOf $ arbitrary `suchThat` (`notElem` ['\NUL', '\n']) -- alternatively: linesGen = arbitrary `suchThat` (all (all (`notElem` ['\NUL', '\n']))) However, I ju

Re: [Haskell-cafe] Custom QuickCheck Gens without custom shrinks

2012-08-15 Thread Niklas Hambüchen
Oh, this is silly. Of course it is: forAllShrink linesGen shrink ... On 15/08/12 20:35, Niklas Hambüchen wrote: > I wrote this Gen to generate lines of texts without \NUL and \n: > > fullLinesProp = forAll linesGen ... > > linesGen = listOf . listOf $ arbitrary `such

[Haskell-cafe] Lazy decoding of a list with Data.Binary

2012-08-21 Thread Niklas Hambüchen
I just encountered the following problem: http://stackoverflow.com/questions/11695373/lazy-decoding-of-a-list-with-data-binary If I get that correctly, there once was a discussion about adding a Data.Binary.Lazy to binary: http://www.haskell.org/pipermail/haskell-cafe/2007-November/034758.html

[Haskell-cafe] Conduit: Where to run monad stacks?

2012-08-22 Thread Niklas Hambüchen
Today I was surprised that transPipe is called for every chunk of data going through my pipe, rendering the StateT I put in useless, because it was always restarted with the initial value. It would be nice to have some explanation about this, as it makes it easy to write compiling code that has co

Re: [Haskell-cafe] Conduit: Where to run monad stacks?

2012-08-24 Thread Niklas Hambüchen
to it from the > Haddocks. > > Michael > > [1] https://github.com/snoyberg/conduit/issues/67 > [2] https://github.com/snoyberg/conduit/wiki/Dealing-with-monad-transformers > > On Wed, Aug 22, 2012 at 11:19 PM, Niklas Hambüchen wrote: >> Today I was surprised that transPipe is

[Haskell-cafe] Handle close on GC leading to wrong reported exit codes?

2012-08-24 Thread Niklas Hambüchen
According to System.IO, handles are automatically closed once they are garbage-collected. This served me well for files so far, but for processes, it gives me a weird problem: If I don't prevent my stdErr handle from being garbage-collected, the exit code reported by getProcessExitCode is just wro

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-30 Thread Niklas Hambüchen
Well, overhead or not, it would be nice to at least have *some* solution. Currently, it just doesn't work. I am sure that as soon the functionality is there, somebody will step in to fake it fast. On 15/08/12 06:25, Donn Cave wrote: > Quoth Alexander Kjeldaas , > >> See access(2) > > ... a cla

Re: [Haskell-cafe] hellno - a somewhat different approach to tackling cabal hell

2012-09-02 Thread Niklas Hambüchen
Hell yeah! Looks like a nice approach. On Sun 02 Sep 2012 19:25:08 BST, Danny B wrote: > Like many of us, I've suffered from cabal dependency hell and sought relief. > > I wasn't exactly happy with sandboxes - because using per-project ones > meant package duplication and shared sandboxes suffer

[Haskell-cafe] Monospace code in Haddock

2012-09-05 Thread Niklas Hambüchen
Is it possible to use inlined monospaced font in Haddock that does *not* replace < and > to links and does *not* link to Haskell functions (like @ and ' and " and ` do)? Like: -- | This function gives you @str@ something :: String The @ above of course makes everything unreadable (as it thinks

Re: [Haskell-cafe] Monospace code in Haddock

2012-09-05 Thread Niklas Hambüchen
OK, but how to prevent it from linking to foo if I have a function foo in my module? On 05/09/12 20:50, Simon Hengel wrote: > On Wed, Sep 05, 2012 at 08:40:37PM +0100, Niklas Hambüchen wrote: >> Is it possible to use inlined monospaced font in Haddock that does *not* >> replace &

Re: [Haskell-cafe] Monospace code in Haddock

2012-09-05 Thread Niklas Hambüchen
links to your functions in inline monospaced text, and you can't turn that off. -- | Gives you @\hello\@ will therefore link to functions 'span' and 'hello' if they exist. On 05/09/12 21:04, Simon Hengel wrote: > On Wed, Sep 05, 2012 at 08:53:26PM +0100, Niklas Hambüc

Re: [Haskell-cafe] Monospace code in Haddock

2012-09-05 Thread Niklas Hambüchen
monospace. On 05/09/12 21:29, Simon Hengel wrote: > On Wed, Sep 05, 2012 at 09:11:47PM +0100, Niklas Hambüchen wrote: >> When you write: >> >> -- | This function returns the string @hello@ >> >> and you have a function called hello in scope, haddock will hyperli

[Haskell-cafe] [Security] Put haskell.org on https

2012-10-27 Thread Niklas Hambüchen
(I have mentioned this several times on #haskell, but nothing has happened so far.) Are you aware that all haskell.org websites (hackage, HaskellWiki, ghc trac) allow unencrypted http connections only? This means that everyone in the same Wifi can potentially - read you passwords for all of thes

Re: [Haskell-cafe] [Security] Put haskell.org on https

2012-10-28 Thread Niklas Hambüchen
No matter what we do with cabal, it would be great if I could soon point my browser at https://haskell.org *anyway*. On 28/10/12 23:55, Patrick Mylund Nielsen wrote: > Of course, as long as Cabal itself is distributed through this same > https-enabled site, you have the same PKI-backed security as

Re: [Haskell-cafe] Optimal line length for haskell

2012-10-29 Thread Niklas Hambüchen
I would prefer to completely ignore line lengths when writing Haskell. In general, giving good names to things in where-clauses automatically keeps my code "short enough". My opinion is that different people like different code layouts, and when formatting code in certain ways, we will always hav

Re: [Haskell-cafe] [Security] Put haskell.org on https

2012-10-30 Thread Niklas Hambüchen
So how do we go forward about getting the SSL certificate and installing it? On 29/10/12 01:06, Patrick Mylund Nielsen wrote: > Sure. No matter what's done in Cabal, the clients for everything else > will still be mainly browsers. > > On Mon, Oct 29, 2012 at 12:59 AM, Niklas Ham

[Haskell-cafe] ANNOUNCE: network-house

2012-10-30 Thread Niklas Hambüchen
In absence of a library that easily parses network packages from recorded raw data (not sockets), I have taken the network stack from the House project and put it into a separate package, network-house. http://hackage.haskell.org/package/network-house This library allows you to parse Ethernet, TC

[Haskell-cafe] Compiling with hsc2hs and -Wextra

2012-11-07 Thread Niklas Hambüchen
Hi, when I compile my C binding using hsc2hs with the -Wextra enabled in my cabal file: cc-options: -std=c99 -Wall -Wextra -Werror This breaks the compilation started by hsc2hs: MyHsc.hsc: In function ‘main’: MyHsc.hsc:16:15: error: unused parameter ‘argc’ [-Werror=unused-parameter]

Re: [Haskell-cafe] using createProcess and waitForProcess, but mpg123 plays for only 6 seconds

2012-11-15 Thread Niklas Hambüchen
Yes, the automatic closing of handles has confused me as well when I wrote Proctest: http://hackage.haskell.org/packages/archive/proctest/latest/doc/html/Test-Proctest.html It might contain useful examples on how to deal with processes. Niklas On 15/11/12 14:42, Herbert Valerio Riedel wrote: >

Re: [Haskell-cafe] Is hackage.haskell.org down?

2012-12-04 Thread Niklas Hambüchen
Down for me. On Tue 04 Dec 2012 15:44:10 GMT, Ivan Perez wrote: > Hi haskellers, > > I've been having problems to access hackage.haskell.org for the past > 2-4 hours. Is everything ok? > > Cheers, > Ivan > > ___ > Haskell-Cafe mailing list > Haskell-Cafe

[Haskell-cafe] GHC shows wrong line number in error?

2012-12-20 Thread Niklas Hambüchen
Hello, I have some code like this (the contents don't really matter): 42 data TestChain next = ChainEntry (forall b . TestG b) next 43 | ChainDescribe String (Free TestChain... 44 deriving (Functor) 45 46 -- deriving instance Show a => Show (TestChain a

[Haskell-cafe] Cabal bug? repeat "--reinstall"

2013-01-04 Thread Niklas Hambüchen
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? ___ Haskell

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

2013-01-10 Thread Niklas Hambüchen
Where do we report this? On 05/01/13 02:36, Albert Y. C. Lai wrote: > 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 ar

[Haskell-cafe] Parallel cabal install ignores order

2013-01-10 Thread Niklas Hambüchen
I have "jobs: 4" enabled in my cabal config to get parallel installs with cabal-install >= 1.16. When I do cabal install --reinstall --force-reinstalls world to reinstall all packages (e.g. to enable profiling or shared), it fails after some point, complaining that the required dependency package

Re: [Haskell-cafe] Parallel cabal install ignores order

2013-01-10 Thread Niklas Hambüchen
Done: https://github.com/haskell/cabal/issues/1174 On 11/01/13 01:50, Ivan Lazar Miljenovic wrote: > On 11 January 2013 10:27, Niklas Hambüchen wrote: >> I have "jobs: 4" enabled in my cabal config to get parallel installs >> with cabal-install >= 1.16. >> >

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

2013-01-10 Thread Niklas Hambüchen
Ahah on Github. Filed as https://github.com/haskell/cabal/issues/1175. On Fri 11 Jan 2013 01:21:11 CET, Niklas Hambüchen wrote: > Where do we report this? > > On 05/01/13 02:36, Albert Y. C. Lai wrote: >> On 13-01-04 04:36 PM, Niklas Hambüchen wrote: >>> I get the fo

Re: [Haskell-cafe] Ticking time bomb

2013-01-30 Thread Niklas Hambüchen
As long as we upload packages via plain HTTP, signing won't help though. On Wed 30 Jan 2013 19:27:32 GMT, Edward Z. Yang wrote: > https://status.heroku.com/incidents/489 > > Unsigned Hackage packages are a ticking time bomb. > > Cheers, > Edward > > ___

Re: [Haskell-cafe] Ticking time bomb

2013-01-30 Thread Niklas Hambüchen
You are right, I skipped over that this was actually a server-side exploit - sure, end-to-end signing will help here. On 30/01/13 19:47, Edward Z. Yang wrote: >> As long as we upload packages via plain HTTP, signing won't help though. ___ Haskell-Cafe m

Re: [Haskell-cafe] Why does not zipWith' exist

2013-02-01 Thread Niklas Hambüchen
I recently asked a similar question about strict scans (e.g. scanl') and got the same response to use a strictify function. Although I would argue that fun' is syntactically more convenient than (strictList . fun), I'd agree that composition is good. Maybe it would make sense to add to have tha

Re: [Haskell-cafe] generalized, tail-recursive left fold that can finish tne computation prematurely

2013-02-18 Thread Niklas Hambüchen
On 18/02/13 16:10, Petr Pudlák wrote: > - `foldr` is unsuitable because it counts the elements from the end, > while `!!` needs counting from the start (and it's not tail recursive). It is common misconception that foldr processes the list "from the right". foldr "brackets" from the right, but th

Re: [Haskell-cafe] Aeson + MongoDB, how to effortlessly store and retrieve json?

2013-02-18 Thread Niklas Hambüchen
Not sure if this is helpful, but have a look at "aesonbson": https://github.com/nh2/aesonbson/blob/master/Data/AesonBson.hs It can convert aeson to bson and the other way around, so you can easily convert 'Object's to 'Document's. Is that what you are looking for? On 18/02/13 21:37, Alfredo Di

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

2013-02-23 Thread Niklas Hambüchen
Hi, I just did cabal update and cabal install ghc-mod, and for some reason it tries to install version 0.3.0 from 3 years ago: " cabal install ghc-mod -v Reading available packages... Choosing modular solver. Resolving dependencies... Ready to install ghc-mod-0.3.0 Downloading ghc-mod-0.3.0... "

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

2013-02-24 Thread Niklas Hambüchen
You are right, my "ghc-7.4.2" was broken in ghc-pkg list; I fixed the problem by killing my .cabal folder (as so often). Do you know if it is possible to make ghc-pkg list print some actual text when packages are broken instead of writing them in red (which goes away on output redirection)? Thank

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

2013-02-25 Thread Niklas Hambüchen
Yep, I usually kill ~/.ghc and ~/.cabal for this kind of reset. On Mon 25 Feb 2013 16:56:56 GMT, Brent Yorgey wrote: > On Sun, Feb 24, 2013 at 02:33:55PM +0000, Niklas Hambüchen wrote: >> You are right, my "ghc-7.4.2" was broken in ghc-pkg list; I fixed the >> problem by

Re: [Haskell-cafe] How to return a network connection to C

2013-02-28 Thread Niklas Hambüchen
What data type are you dealing with exactly? If you have a socket, I guess you can just use it from C (via FFI). PS: By "Network.Connection", do you mean http://hackage.haskell.org/package/network-connection-0.1.1 ? Seems deprecated. On 28/02/13 06:14, C K Kashyap wrote: > Hi, > I am using Netwo

[Haskell-cafe] ANNOUNCE: netpbm

2013-03-01 Thread Niklas Hambüchen
I'm happy to announce a new library, "netpbm", a full implementation of the netpbm image formats (PPM, PGM, PBM) in pure Haskell. The P*N formats describe themselves as "as easy as possible"; they mainly consist of dimensions + uncompressed data and are used especially in between graphics programs

Re: [Haskell-cafe] attoparsec and backtracking

2013-03-15 Thread Niklas Hambüchen
Is it not possible to add an alternative (no pun intended) to <|> that supports the semantics Evan wants? I would agree that what attoparsec does for <|> of Alternative and mplus for MonadPlus is correct since e.g. the mplus laws say that a failure must be identity and therefore the following alte

Re: [Haskell-cafe] attoparsec and backtracking

2013-03-16 Thread Niklas Hambüchen
@Evan Thanks for that link, I posted a somewhat longer argument in there. Personally, I'd love <||>. On Sun 17 Mar 2013 02:02:44 GMT, Evan Laforge wrote: > On Fri, Mar 15, 2013 at 8:49 PM, Niklas Hambüchen wrote: >> Is it not possible to add an alternative (no pun i

[Haskell-cafe] Word8 literals in ByteString haddock?

2013-03-26 Thread Niklas Hambüchen
Hey, according to http://hackage.haskell.org/packages/archive/bytestring/0.10.2.0/doc/html/Data-ByteString.html#v:split I can write: split '\n' "a\nb\nd\ne" Can I really do that? I don't know of a way to make a '\n' literal be a Word8, so maybe these Haddocks are wrong? I guess they would apply

[Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-28 Thread Niklas Hambüchen
(This is a slightly detailed email. If you are the maintainer of one of the packages benchmarked here, you might want to read it though.) Today I was looking for a Priority Queue that also allows a delete operation (some call this a "Priority Search Queue"). I found http://stackoverflow.com/ques

Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Hey Scott, I quickly tried your suggestion, plugging in foldr' from Data.Foldable and sprinkling a few seqs in some places, but it doesn't help the stack overflow. On Fri 29 Mar 2013 16:23:55 GMT, Scott Dillard wrote: > I do not know why it overflows. It's been a while, but isn't the > answer u

Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Hey Kazu, I added GHC's PSQ to the benchmark, the new figures are on http://htmlpreview.github.com/?https://raw.github.com/nh2/psqueue-benchmarks/master/report.html No, it does not stack overflow, and it seems to perform slightly better than the other implementations; it also doesn't suffer from

Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Hey Louis, I think that queuelike is still a nice psqueue implementation (and I personally don't dislike the api), so may I ask two more questions: * Do you have any clue why toList is 10 times slower than in the other implementation? It is based on extract, and queuelike's extract is very fast c

Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Does that mean the repo is still there without web access or gone? On 29/03/13 20:14, Henning Thielemann wrote: > Was it on code.haskell.org? Then it might have been moved to a non-web > directory after the last attack 2011. ___ Haskell-Cafe mailing lis

Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-04-06 Thread Niklas Hambüchen
On 30/03/13 06:44, Louis Wasserman wrote: > That said, I'm not sure I follow how queuelike is a > psqueue at all as opposed to a pqueue? Louis, you are actually right. I was tricked by the delete function, which takes only the queue, not the key, so it simply pops the top - queuelike is not a psq

Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-04-06 Thread Niklas Hambüchen
@Cale, do you have a repo of fingertree-psqueue around? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Vector Fabrics is hiring!

2013-04-08 Thread Niklas Hambüchen
On Mon 08 Apr 2013 17:19:08 SGT, Oliver Charles wrote: >> * Your friends and colleagues describe you as a "rockstar" programmer; >>your programming ability is way above average; > Good luck hiring smart people. I get a high score in http://areyouabrogrammer.com - does that qualify me for the

Re: [Haskell-cafe] GSoC Project Proposal: Markdown support for Haddock

2013-04-08 Thread Niklas Hambüchen
Could you elaborate a bit on which markdown features you support (or even better: write it into your module haddocks)? Thinks like - autolink detection - ```language blocks? Also, you build on performance-oriented libraries - it would be cool if you could make a small benchmark comparing with the

[Haskell-cafe] Web servers: Running them multiple times in a ghci session

2013-04-10 Thread Niklas Hambüchen
I'm writing a web server app, which I run in ghci: :main localhost 8000 Unfortunately, after Ctrl-C and :reload, running it again: ** Exception: bind: resource busy (Address already in use) This is pretty annoying, because quitting-and-restarting takes a lot of time since I have many dependenci

Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-04-12 Thread Niklas Hambüchen
I actually found a (potential) problem with the GHC implementation. See here: https://github.com/nh2/psqueue-benchmarks/blob/db89731c5b4bdd2ff2ef81022a65f894036d8453/QueueBenchmark.hs#L44 If I fromList 100 entries into the queue, it stack space overflows. I got the same problem with the fin

Re: [Haskell-cafe] -inplace is shadowed by package -

2013-04-14 Thread Niklas Hambüchen
Hi, I just got the same thing with attoparsec GIT: Preprocessing benchmark 'benchmarks' for attoparsec-0.10.4.0... Building benchmark benchmarks... creating dist/build/benchmarks creating dist/build/benchmarks/benchmarks-tmp /home/niklas/opt/haskell-7.4/bin/ghc --make -fbuilding-cabal-package -O

[Haskell-cafe] GSoC proposal: Haskell AST-based refactoring and API upgrading tool

2013-04-28 Thread Niklas Hambüchen
I would like to propose the development of source code refactoring tool that operates on Haskell source code ASTs and lets you formulate rewrite rules written in Haskell. Objective - The goal is to make refactorings easier and allow global code changes that might be incredibly tedious to

Re: [Haskell-cafe] GSoC proposal: Haskell AST-based refactoring and API upgrading tool

2013-04-29 Thread Niklas Hambüchen
r 2013, at 07:00, Niklas Hambüchen wrote: > >> I would like to propose the development of source code refactoring tool >> that operates on Haskell source code ASTs and lets you formulate rewrite >> rules written in Haskell. > > > Seen this? > http://www.ha

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

2013-05-03 Thread Niklas Hambüchen
> runhaskell -fno-warn-unused-matches Myfile.hs [some compile error] > runhaskell -fno-warn-unused-matches Myfile.hs [no output whatsoever but exit code 127] > runhaskell -asdf Myfile.hs ghc: unrecognised flags: -asdf > runhaskell -fasdf Myfile.hs [no output whatsoever but exit code 127] Not s

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Niklas Hambüchen
While I certainly enjoy the discussion, how about addressing one of the original problems: On 02/05/13 13:27, Adrian May wrote: > I just tried to use Flippi. It broke because of the syntax change so I > tried WASH. I couldn't even install it because of the syntax change. I just fixed that in http

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Niklas Hambüchen
On 04/05/13 01:52, Nicolas Trangez wrote: > On Fri, 2013-05-03 at 10:40 -0700, Hilco Wijbenga wrote: >> Given the apparent simplicity of the changes needed to keep one's >> Haskell code up to snuff and the strong typing inherent in Haskell >> code, would it not be possible to create something simil

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Niklas Hambüchen
All right, here you go: https://github.com/nh2/WashNGo https://github.com/nh2/WashNGo/commit/08010e7404219470a827f3e4172004f9d2aedc29 Took me around 75 minutes. Think about it a bit: I just ported thirty thousand lines of code that I have never seen before and that has bit-rotted for over six y

  1   2   >