Re: [Haskell-cafe] Over general types are too easy to make.

2012-08-31 Thread John Wiegley
timothyho...@seznam.cz writes: data BadFoo = BadBar{ badFoo::Int} | BadFrog{ badFrog::String, badChicken::Int} This is fine, until we want to write a function that acts on Frogs but not on Bars. The best we can do is throw a runtime error when passed a Bar and not a Foo: You can

Re: [Haskell-cafe] Is Hackage down?

2012-09-14 Thread John Wiegley
C K Kashyap ckkash...@gmail.com writes: Is it just me or is Hackage indeed been going down more frequently of late? It's not just you. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] foldr (.) id

2012-10-26 Thread John Wiegley
Greg Fitzgerald gari...@gmail.com writes: I've recently found myself using the expression: foldr (.) id to compose a list (or Foldable) of functions. You want the Endo monoid: ghci appEndo (Endo (+ 10) Endo (+ 20)) $ 3 33 John ___

Re: [Haskell-cafe] foldr (.) id

2012-10-26 Thread John Wiegley
Thiago Negri evoh...@gmail.com writes: Can you please show some examples where it might be useful? I miss the point. I guess if he already has a list of functions, Endo won't help. Endo just lets you treat functions as monoids, so you can foldMap, etc. In that case, foldr (.) id is pretty

Re: [Haskell-cafe] Instead of Haskell running on the JVM is there a way for Haskell to call a JVM language ...

2012-11-19 Thread John Wiegley
KC kc1...@gmail.com writes: Instead of Haskell running on the JVM is there a way for Haskell to call a JVM language (or generate bytecode) to access the Java class libraries when needed? Or Is there a way for a JVM language or bytecode to call Haskell when needed? I'd be very interested

Re: [Haskell-cafe] Is there a tool like ri from ruby?

2012-11-25 Thread John Wiegley
. Here's the wiki page about it: http://www.haskell.org/haskellwiki/Hoogle See also: http://newartisans.com/2012/09/running-a-fully-local-hoogle/ With this setup I can use :doc head in my ghci sessions, and see docs very similar to what ri would show. -- John Wiegley FP Complete

Re: [Haskell-cafe] Category Theory and Haskell

2012-11-25 Thread John Wiegley
= is rather tricky. Doing this exploration in Haskell -- with the aid of the type-checker -- made certain connections clear that were difficult to see in the abstract. And it was plenty of fun besides. :) Happy brain spelunking, -- John Wiegley FP Complete Haskell tools, training

[Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
been done. A search for likely candidates did not turn up anything obvious in Hoogle, but as my knowledge of the whole of Hackage is minimal, I would appreciate any wiser minds that can inform me. Thank you, -- John Wiegley FP Complete Haskell tools, training and consulting

Re: [Haskell-cafe] [Haskell] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
Henning Thielemann lemm...@henning-thielemann.de writes: Does the And monad fulfill the monad laws? In a proper monad an interim (return x) (without a '-') is a no-op. You are very right. I will make the necessary changes. -- John Wiegley FP Complete Haskell tools

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
Conrad Parker con...@metadecks.org writes: these sound powerful, but how would I do something esoteric like if/elseIf/endIf ? Can you show me an example of what you'd like to express? -- John Wiegley FP Complete Haskell tools, training and consulting http

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
docs: http://ftp.newartisans.com/pub/monoid-bool/Data-Monoid-Bool.html I'll ask Ross Paterson to deprecate monad-bool. And in future, I'll seek review here first before uploading. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
distinguishing the final value as either a Left (result from short-circuiting) or a Right (final value). And EitherT can already do that, it just lacks a convenience function to make it easier (i.e, not having to write lots of nested if statements). -- John Wiegley FP Complete

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
John Wiegley jo...@fpcomplete.com writes: And EitherT can already do that, it just lacks a convenience function to make it easier (i.e, not having to write lots of nested if statements). Never mind, when/unless + left work just fine for this. -- John Wiegley FP Complete

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
John Wiegley jo...@fpcomplete.com writes: Never mind, when/unless + left work just fine for this. You know, it's been a humorous day. First ekmett showed that I can't make a sane Monad instance for AndM or OrM. Then I discovered I can't make a reasonable Monoid (no mempty, given only 'toBool

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-23 Thread John Wiegley
will certainly endeavor to make the most valuable mistakes I can from here on, with the help of such a gracious community. :) Yours, -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net

Re: [Haskell-cafe] Use forM_ with Maybe, it's Foldable!

2013-01-26 Thread John Wiegley
Felipe Almeida Lessa felipe.le...@gmail.com writes: A few days ago I decided to hoogle the type of whenJust [2] and what I discovered is that import Data.Foldable (forM_) whenJust = forM_ You can also use for_, if you want to use Applicative instead of Monad. -- John Wiegley FP

Re: [Haskell-cafe] ANN: lazy-csv - the fastest and most space-efficient parser for CSV

2013-02-25 Thread John Wiegley
would be very interested in those results, Malcolm. Thanks, -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Threadscope 0.2.2 goes in segmentation fault on Mac Os X 10.8.3

2013-03-30 Thread John Wiegley
of the process at the time it died? Thanks, -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net ___ Haskell-Cafe mailing list Haskell-Cafe

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

2013-04-05 Thread John Wiegley
Johan Tibell johan.tib...@gmail.com writes: I suggest that we implement an alternative haddock syntax that's a superset of Markdown. Definite +1 from me too. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw

[Haskell-cafe] Nightly builds of GHC HEAD for OS X 10.8

2013-06-12 Thread John Wiegley
this build takes 8h15m minutes, so I figured this might save others some CPU heat. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net

Re: [Haskell-cafe] Nightly builds of GHC HEAD for OS X 10.8

2013-06-21 Thread John Wiegley
John Wiegley jo...@fpcomplete.com writes: Since mid-January, I’ve been running nightly builds of GHC on my Mac Pro for 10.8.x, 64-bit. I’ve decided to make these results publically downloadable here: http://ghc.newartisans.com. Just a note: I'm now including builds and logs for Ubuntu

Re: [Haskell-cafe] ANNOUNCE: module-management-0.9.3 - clean import lists, split and merge modules

2013-06-27 Thread John Wiegley
to writing it yet. Thanks! -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] ANNOUNCE: module-management-0.9.3 - clean import lists, split and merge modules

2013-06-28 Thread John Wiegley
David Fox d...@seereason.com writes: Cliff Beshers wrote a CLI for this, I will add it as a cabal executable in the next version. Oh, also, I was unable to build the library using GHC 7.4.2. It looks like it still depends on the old Exception stuff that used to be Prelude? -- John Wiegley

Re: [Haskell-cafe] ANNOUNCE: tasty, a new testing framework

2013-08-06 Thread John Wiegley
select one over another. I use hspec currently (which also integrates with HUnit, QuickCheck, etc.), and couldn't tell at a glance what tasty might offer. And I particularly dislike writing tests inside of a gigantic list; I much prefer the monadic style of hspec. -- John Wiegley FP Complete

Re: [Haskell-cafe] ScopedTypeVariables

2013-08-06 Thread John Wiegley
wondered why I have to enable ScopedTypeVariables in those cases -- when I'm not turning it on to scope any type variables, but just to make annotations possible in more places. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread John Wiegley
Dan Burton danburton.em...@gmail.com writes: under reversed (take 10) ['a'.. 'z'] qrstuvwxyz Excellent, thanks! -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net

Re: [Haskell-cafe] definition of the term combinator

2013-08-23 Thread John Wiegley
a function that makes new functions out of other functions, which it can often do as a pure combinator, but isn't always a combinator per se. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net

[Haskell-cafe] This is a mail system test, please ignore

2013-09-10 Thread John Wiegley
Testing the new e-mail services at haskell.org. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] Please excuse brief service disruption

2013-09-10 Thread John Wiegley
The e-mail services at haskell.org were switched from exim4 to postfix tonight, please excuse the service disruption. For about one hour e-mails were not being accepted to the mailing lists. All should be resolved now. -- John Wiegley FP Complete Haskell tools, training

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

2013-09-10 Thread John Wiegley
be foldl f (in brackets) f acc x (end of brackets) xs To: foldl :: (a - b - a) - a - [b] - a foldl f z [] = z foldl f z (x:xs) = foldl f (f z x) xs How is that more concise or preferable? -- John Wiegley FP Complete Haskell

Re: [Haskell-cafe] Creating a local Hoogle ...

2013-09-23 Thread John Wiegley
: rehoo -j4 -c64 . Where 4 is for a 4-core machine. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-01 Thread John Wiegley
another, I reach for nmap in the same way that I reach for fmap to transform the mapped type. -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net

Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-07 Thread John Wiegley
Daniil Frumin difru...@gmail.com writes: Isn't it the case that there could be more than one natural transformation between functors? Yes, I imagine there would have to be some newtype wrappers to distinguish in those cases. -- John Wiegley FP Complete Haskell tools

Re: [Haskell-cafe] MonadBaseControl IO instance for conduits ?

2013-10-11 Thread John Wiegley
Aleksey Uymanov s9gf4...@gmail.com writes: Is it posible to create instance of MonadBaseControl IO (ConduitM i o m) ? No, it is not, for approximately the same reason that you cannot create one for ContT (or any form of continuation). -- John Wiegley FP Complete