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
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
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
___
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
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
.
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
= 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
:
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
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
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
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
34 matches
Mail list logo