On Tue, Aug 7, 2012 at 7:04 AM, Dan Burton danburton.em...@gmail.com wrote:
As a side note, since the code base is relatively small, it can also serve
as a simple demonstration of how to use a cabal flag
in conjunction with CPP to selectively include swaths of code
(see Control/Monad/Tardis.hs
On Sun, Apr 15, 2012 at 7:14 PM, Steffen Schuldenzucker
sschuldenzuc...@uni-bonn.de wrote:
On 04/13/2012 10:49 PM, Ben Millwood wrote:
I'm pleased to announce my first genuinely original Hackage package:
notcpp-0.0.1!
http://hackage.haskell.org/package/notcpp
[...]
Why
It seems I wasn't subscribed to haskell-cafe so this reply didn't get
through (sorry for sending this twice, Felipe).
I've now subscribed with delivery turned off for -cafe so if you want
me to read a response be sure to address me directly :)
On Tue, Jan 4, 2011 at 5:08 AM, Ben Millwood hask
The actual, entire, complete definitions of sequence and sequence_ are
(or at least, could be):
sequence [] = return []
sequence (m:ms) = do
x - m
xs - sequence ms
return (x:xs)
-- or, equivalently:
sequence' = foldr (liftM2 (:)) (return [])
sequence_ [] = return ()
sequence_
On Sat, Oct 30, 2010 at 11:56 AM, Arnaud Bailly arnaud.oq...@gmail.com wrote:
Hello,
All of a sudden, the package regex-posix-0.94.2 failed to link after i
installed a couple of other packages (http, json). When I try to
reinstall it, I got the folowing errors:
D:\projets\crete1941cabal
On Fri, Oct 29, 2010 at 5:06 AM, Steve Severance st...@medwizard.net wrote:
whenever I here any open source community
(yeah...everyone not just haskell) tell beginners to contribute a
package I always scratch my head with a little bit of wonder. Would
you really want a package that someone
On Fri, Oct 29, 2010 at 1:33 PM, Tillmann Rendel
ren...@informatik.uni-marburg.de wrote:
Note that the case of (==) and (/=) is slightly different, because not only
can (/=) be defined in terms (==), but also the other way around. The
default definitions of (==) and (/=) are mutually
On Thu, Oct 28, 2010 at 11:12 AM, John Smith volderm...@hotmail.com wrote:
On 28/10/2010 10:15, Alexander Kjeldaas wrote:
Hi haskellers.
Reading through the Haskell Prime suggestions, one that caught my eye is
the CompositionAsDot issue.
I'm especially thinking of the Pro issue:
* Paves
On Tue, Oct 26, 2010 at 5:11 PM, Dupont Corentin
corentin.dup...@gmail.com wrote:
Hello again café,
I have a command line program that takes input from various handles
(actually network sockets) like this:
s - hGetLine h
etc.
I'd like to unit test this. How can I do?
If all you ever do
On Tue, Oct 19, 2010 at 2:32 PM, Michael Snoyman mich...@snoyman.com wrote:
Algorithmic Problem Solving
I think this needs to go, because I'm really having a hard time
imagining any programmer who doesn't do this.
High Assurance Software Development
This sounds vague to me and/or the same as
On Sun, Oct 17, 2010 at 11:15 AM, Malcolm Wallace
malcolm.wall...@me.com wrote:
The problem with the code you originally posted was that it looked like
this:
f r = do r' - something
f r'
something else -- this is dead code
That is, the computation is non-terminating,
On Fri, Oct 15, 2010 at 9:28 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
I'm still quite
surprised that there's no tool anywhere which will trivially print out the
reduction sequence for executing an expression. You'd think this would be
laughably easy, and yet nobody has done it yet.
On Fri, Oct 8, 2010 at 8:56 AM, Petr Pudlak d...@pudlak.name wrote:
thanks for both the explanation (Donn) and the sound sample (Luke).
Unfortunately, hurry is pronounced differently in British and US English
[1], so again I was a little bit confused :-). But Luke's sound sample made
it clear
On Thu, Oct 7, 2010 at 1:44 PM, Luke Palmer lrpal...@gmail.com wrote:
The section works because (a %^) (for some operator %^) is short
for (%^) a and (%^ a) is short for flip (%^) a. Sections
don't expand into lambdas.
According to the report they do:
On Tue, Sep 28, 2010 at 5:55 AM, Evan Laforge qdun...@gmail.com wrote:
I write haskell and python in a proportional font and it hasn't yet
let to tabs, so no pain so far :)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Sat, Sep 25, 2010 at 3:01 AM, Gregory Crosswhite
gcr...@phys.washington.edu wrote:
==
import Control.Applicative
import Control.Concurrent
import Control.Concurrent.MVar
newtype AIO a = AIO {unAIO :: IO a}
instance
2010/9/19 Николай Кудасов crazy.fiz...@gmail.com:
Hi, cafe,
I have a stange thing when trying to install type-level package:
$ sudo ./Setup.hs configure
Configuring type-level-0.2.4...
$ sudo ./Setup.hs build
Preprocessing library type-level-0.2.4...
Building type-level-0.2.4...
[1 of 8]
On Wed, Sep 15, 2010 at 12:45 AM, Chad Scherrer chad.scher...@gmail.com wrote:
Hello,
I need to be able to use strict bytestrings to efficiently build a
lazy bytestring, so I'm using putByteString in Data.Binary. But I also
need random numbers, so I'm using mwc-random. I end up in the IO Put
On Thu, Sep 16, 2010 at 4:00 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Because Parsec-3 apparently still has some speed regressions compared
to Parsec-2 (I'm not qualified to note whether its design is slow or
if you have to use it differently to get good performance out of
On Fri, Sep 17, 2010 at 1:44 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 17 September 2010 03:18, Henning Thielemann
My suggestion is to move the Unsafe modules to a new package 'unsafe'.
Then you can easily spot all dirty packages by looking at reverse
dependencies of
On Wed, Sep 15, 2010 at 2:11 PM, Kevin Jardine kevinjard...@gmail.com wrote:
I do think that
defObj(MyType)
looks a bit cleaner than
$(defObj MyType)
I believe as of GHC 6.12 you no longer need the $() around top-level
splices. So that would just be:
defObj MyType
On Tue, Sep 14, 2010 at 9:44 PM, Mitar mmi...@gmail.com wrote:
Hi!
On Tue, Sep 14, 2010 at 9:04 PM, Gregory Collins
g...@gregorycollins.net wrote:
That's surprising to me -- this is how we kill the Snap webserver
(killThread the controlling thread...).
Yes. This does work. The only problem
On Mon, Sep 13, 2010 at 8:21 AM, Alexander Kotelnikov sa...@myxomop.com wrote:
And, also, would it make any difference if
do {p - e; stmts} = let ok p = do {stmts}
ok _ = fail ...
in e = ok
is redefined as e = (\p - do {stmts})?
This is the magic that allows pattern-match
On Fri, Sep 10, 2010 at 7:40 AM, JP Moresmau jpmores...@gmail.com wrote:
I suppose even using GHC for building and something else
(haskell-src-exts?) for code handling would leave us with compilation
messages at the wrong place.
I don't quite understand your use case so I'm not sure it helps,
Good evening, cafe,
Having recently taken on maintenance of a package that depends on
template-haskell, I've been in some discussion with users and
dependencies of my package about how best to write a library that
works with multiple incompatible versions of a dependency. The two
main approaches
On Tue, Sep 7, 2010 at 2:45 PM, Dimitry Golubovsky golubov...@gmail.com wrote:
unThrow a = unsafePerformIO $ (E.evaluate a = return . Right) `E.catch`
(\e - return $ Left e)
-- or perhaps the right argument of catch could be just (return . Left)?
I have only one thing to add to this discussion:
On Fri, Sep 3, 2010 at 5:16 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
2b) Is it OK to promote functions that use a class to being class
methods? When I was discussing this in #haskell several people
mentioned that defining
On Thu, Sep 2, 2010 at 9:31 PM, Andrew U. Frank
fran...@geoinfo.tuwien.ac.at wrote:
I have a user input (string) and need to select one of two types.
depending what the input is. is this possible?
data A
data B
data X n = X String
op :: String - X n
op a = X a :: X A
op b = X b :: X B
2010/8/17 Geoffrey Mainland mainl...@eecs.harvard.edu:
On 08/17/2010 12:28, Ben Millwood wrote:
2010/8/17 Jonas Almström Duregård jonas.dureg...@gmail.com:
Hi,
Has there been any progress with this package? Like you I have also
tried to contact Matt and like you I have ended up making my own
On Wed, Aug 18, 2010 at 8:31 AM, Evan Laforge qdun...@gmail.com wrote:
I was trying to turn on --global by default
user-install: False
I think it's not completely a stupid idea to have profiling default
off. I personally do not really enjoy the fact that I compile
everything three times
erred on the conservative side. Any other comments on the package in
general are appreciated too, since this is the first time I've ever
uploaded anything to Hackage. There is a github repository at
http://github.com/benmachine/haskell-src-meta if you want to submit
patches.
Yours sincerely,
Ben
ahead with my upload.
I suppose since there's no reason why I deserve maintainership more
than you you could just go ahead and upload your version instead. You
can see exactly what I've done at my github repository [2].
Yours,
Ben Millwood
[1] http://hackage.haskell.org/package/th-lift-0.4
[2] http
On Mon, Aug 16, 2010 at 8:27 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
The amusing part is, if you sudo cabal
install so it has permission to put the installed files into place, it then
uses root's configuration file instead. *sigh* Well anyway, I managed to
work around that. But...
On Sat, Aug 14, 2010 at 2:38 AM, michael rice nowg...@yahoo.com wrote:
The program below takes a text file and unwraps all lines to 72 columns, but
I'm getting an end of file message at the top of my output.
How do I lose the EOF?
Michael
While many other people have shown you why you
On Thu, Aug 5, 2010 at 2:35 PM, Dino Morelli d...@ui3.info wrote:
One thing I haven't seen anyone else comment on is the width of the new
docs. I have a large (26) monitor and use the browser full-screen (with
xmonad, so even more screen space). When I load these pages, particularly
the
On Thu, Aug 5, 2010 at 5:07 AM, Erik de Castro Lopo
mle...@mega-nerd.com wrote:
The permissiveness of hackage uploads suggests that Hackage needs
to start using something like GPG signing and GPG webs of trust.
The Debian project has stuff like this in place and I'm sure this
community could
On Thu, Aug 5, 2010 at 6:38 PM, Ben Millwood hask...@benmachine.co.uk wrote:
It's worth mentioning that Hackage accounts aren't just given out for
free - one has to specifically request them
Er, to clarify, I mean signup can't be automated, because account
creation is done by a human
On Sun, Jul 18, 2010 at 3:02 AM, Mark Wotton mwot...@gmail.com wrote:
I've uploaded haskell-src-meta-mwotton, using the development version.
It seems to work fine for my applications. It's a bit of a hack, but I
can't think of a better way to do it for now.
mark
--
A UNIX signature isn't
On Sat, Jul 31, 2010 at 2:32 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Forcing; it means that the values are evaluated (up to WHNF) before the
Complex value is constructed:
http://www.haskell.org/ghc/docs/6.12.1/html/users_guide/bang-patterns.html
Actually, this isn't a
On Sat, Jul 31, 2010 at 4:56 PM, michael rice nowg...@yahoo.com wrote:
From: http://en.wikibooks.org/wiki/Haskell/Laziness
Given two functions of one parameter, f and g, we say f is stricter than g if
f x evaluates x to a deeper level than g x
Exercises
1. Which is the stricter
On Sat, Jul 31, 2010 at 5:59 PM, michael rice nowg...@yahoo.com wrote:
OK, in f, *length* already knows it's argument is a list.
In g, *length* doesn't know what's inside the parens, extra evaluation there.
So g is already ahead before we get to what's inside the [] and ().
According to the
On Fri, Jul 30, 2010 at 7:50 PM, Gregory Crosswhite
gcr...@phys.washington.edu wrote:
The reason why this definition never actually appears is because it defines
the constructors using operators rather than names, which is not allowed in
vanilla Haskell. (There is an extension,
On Fri, Jul 30, 2010 at 8:54 PM, michael rice nowg...@yahoo.com wrote:
Thanks all,
Now that I have a (very) rudimentary understanding of Haskell, I figured I'd
back up and have a closer (conceptual) look at type definitions to see what
they have in common, and just happen to pick Maybe and
On Thu, Jul 29, 2010 at 3:49 AM, Eitan Goldshtrom
thesource...@gmail.com wrote:
Perhaps you guys could help me with Cabal now though? I'm
trying to install Orc but it wants base=4.2 and =4.3 and I have 4.1 after
installing the latest release of GHC. Cabal won't upgrade the base. It
complains
On Sun, Jul 18, 2010 at 5:59 PM, Emil Melnikov emilm...@gmail.com wrote:
On 2010, July 18, 23:27
Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
When discussing a similar issue with Manuel Chakravarty, he convinced me
that cunning newtype deriving is actually rather bad in practice and
On Thu, Jul 8, 2010 at 3:45 PM, Daniel Fischer daniel.is.fisc...@web.de wrote:
Well, I made the suggestion of emitting a warning on instance declarations
without method definitions. That would be comparatively easy to implement
(even with an additional check to only emit the warning if the
On Mon, Jul 5, 2010 at 2:41 PM, Ertugrul Soeylemez e...@ertes.de wrote:
Yes, there is some performance loss because of wrapping/unwrapping, but
I think this loss is neglible for most applications. And I'd ask
anyway. This is a discussion thread after all. =)
Pretty much all monad
On Sat, Jun 12, 2010 at 9:05 PM, Daniel Fischer
daniel.is.fisc...@web.de wrote:
On Saturday 12 June 2010 21:43:25, gdwe...@iue.edu wrote:
so I go on declaring in my cabal file
that my package depends on P = A.B.C,
even though I *might* be using new features of P
that wouldn't work with P ==
On Fri, Jun 11, 2010 at 12:46 AM, Felipe Lessa felipe.le...@gmail.com wrote:
eqTypeable :: (Typeable a, Eq a, Typeable b, Eq b) = a - b - Bool
eqTypeable x y = case cast y of
Just y' - x == y'
Nothing - False
...or indeed:
eqTypeable x y = cast x
On Thu, Jun 10, 2010 at 8:57 PM, Maciej Piechotka uzytkown...@gmail.com wrote:
Error monad seems not to be a semantic solution as we exit on success
not failure.
Which is really why the Either monad should not necessarily have Error
associations :)
If you forget about the fail method, the
On Wed, Jun 2, 2010 at 12:37 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Is there a way of making Cabal install dependencies using the system
package manager, then?
For example, I might ask Cabal to install package A. Package A
depends on B and C. A package for B can be
On Tue, May 25, 2010 at 12:36 PM, Ionut G. Stan ionut.g.s...@gmail.com wrote:
Oh, and a small off-topic question? Is it considered a good practice to use
implicit imports in Haskell? I'm trying to learn from existing packages, but
all those import all statements drive me crazy.
It's pretty
On Wed, May 19, 2010 at 10:57 AM, Serguey Zefirov sergu...@gmail.com wrote:
PS
Rationals:
Prelude [1,1+2/3..10] :: [Rational]
[1 % 1,5 % 3,7 % 3,3 % 1,11 % 3,13 % 3,5 % 1,17 % 3,19 % 3,7 % 1,23 %
3,25 % 3,9 % 1,29 % 3,31 % 3]
Same result.
This sounds like a bug to me. The section of the
On Sun, May 16, 2010 at 2:34 AM, Tom Hawkins tomahawk...@gmail.com wrote:
I got the GADT
data DataBox where
DataBox :: (Show d, Eq d, Data d) = d - DataBox
[snip]
but I can't figure out how to implement gunfold for DataBox.
The error message is
Text/XML/Generic.hs:274:23:
On Sun, May 9, 2010 at 7:27 AM, wren ng thornton w...@freegeek.org wrote:
The only examples I can think of where we'd want 'fail'-able patterns are
entirely pedagogical (and are insignificantly altered by not using
'fail'-able patterns). I can't think of any real code where it would
actually
On Sat, May 8, 2010 at 3:26 AM, John Meacham j...@repetae.net wrote:
What counts as unfailable?
(x,y) probably, but what about
data Foo = Foo x y
If we don't allow it, we add 'magic' to tuples, which is a bad thing, if
we do allow it, there are some odd consequences.
adding another
On Thu, May 6, 2010 at 4:05 AM, Ivan Miljenovic
ivan.miljeno...@gmail.com wrote:
Re-CC'ing -cafe:
On 6 May 2010 12:54, Leonel Fonseca leone...@gmail.com wrote:
I wasn't aware of GeneralizedNewtypeDeriving.
I just edited the source file Language.Haskell.TH.Syntax
and left:
newtype Q a = Q
On Thu, May 6, 2010 at 8:55 AM, Pavel Perikov peri...@gmail.com wrote:
Hi, list!.
Now in 6.12.1 we have DeriveFunctor, DeriveFoldable and DeriveTraversable.
This greatly simplifies the reuse structure style of programming. Some
structure (not just _data_ structure) got captured in ADT and
On Thu, May 6, 2010 at 11:51 AM, Bill Atkins watk...@alum.rpi.edu wrote:
Almost - liftM modificationTime has type Status - IO EpochTime. Like
other IO functions (getLine, putStrLn), it returns an IO action but accepts
a pure value (the modification time)
ghci :m +Control.Monad
On Thu, May 6, 2010 at 12:37 PM, Bill Atkins watk...@alum.rpi.edu wrote:
Just curious: why does getModificationTime take an IO FileStatus rather than
a FileStatus?
It doesn't. getModificationTime is a pure function (think of it like a
record accessor).
liftM makes it take IO FileStatus
On Sat, May 1, 2010 at 1:41 PM, Roly Perera
roly.per...@dynamicaspects.org wrote:
I can't for example find Control.Monad.State. I guess I'm missing
something obvious about how things are organised?
The following places might therefore be of interest:
http://hackage.haskell.org/package/mtl
On Sat, May 1, 2010 at 3:33 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
You need to know which library they're in.
You can use the ghc-pkg tool to do this:
$ ghc-pkg find-module Control.Monad.State
/usr/lib/ghc-6.12.1/package.conf.d
monads-fd-0.0.0.1
mtl-1.1.0.2
On Sat, Apr 17, 2010 at 9:50 PM, Daniel Fischer
daniel.is.fisc...@web.de wrote:
{-# LANGUAGE OverlappingInstances, [...]
but with caution:
quicksilver using OverlappingInstances is the haskell equivalent of
buying a new car with high safety rating and replacing the air bags
with poison gas,
On Sun, Apr 18, 2010 at 12:45 AM, Daniel Fischer
daniel.is.fisc...@web.de wrote:
Am Sonntag 18 April 2010 01:23:07 schrieb Ben Millwood:
On Sat, Apr 17, 2010 at 9:50 PM, Daniel Fischer
daniel.is.fisc...@web.de wrote:
{-# LANGUAGE OverlappingInstances, [...]
but with caution:
quicksilver
On Fri, Apr 16, 2010 at 2:40 PM, Phyx loneti...@gmail.com wrote:
So same error. This isn't just limited to HSE though, it can't find packages
like random,time etc either. Keeps reinstalling them on every cabal install.
On Sun, Apr 11, 2010 at 10:54 PM, Jason Dagit da...@codersbase.com wrote:
Or, you could use witness types:
data Vehicle classification = Vehicle { ... }
mkCar :: Vehicle Car
mkTruck :: Vehicle Truck
Then you would export the smart constructors, (mkCar/mkTruck) without
exporting the Vehicle
On Wed, Apr 7, 2010 at 2:22 AM, Thomas Schilling
nomin...@googlemail.com wrote:
I have
set a maximum width on purpose so that it doesn't degrade too badly on
big screens.
I've never really trusted this argument - it's not required that the
browser window occupy the entire screen, so why not
On Mon, Apr 5, 2010 at 3:35 PM, Kim-Ee Yeoh a.biurvo...@asuhan.com wrote:
Something I've noticed is the phenomenon of Help Vampires [1] on this list.
Amy Hoy: As soon as an open source project, language, or what-
have-you achieves a certain notoriety—its half-life, if you will—
they swarm
On Fri, Apr 2, 2010 at 12:40 AM, Christopher Done
chrisd...@googlemail.com wrote:
That's true, it's a nice idea but in practice it's hard to know where
to focus. I've gone with a left nav. I've built up the HTML which is
cross-browser (ie6/7/8/opera/firefox/safari/chrome compat), still need
to
On Fri, Apr 2, 2010 at 4:36 AM, Ben Millwood hask...@benmachine.co.uk wrote:
The
easiest thing to do on visiting the website is read about why Haskell
is so great, and where to find out how to use it.
Uhm, I meant the easiest thing *should be* reading about...
Sorry about
On Sat, Mar 13, 2010 at 3:19 AM, wren ng thornton w...@freegeek.org wrote:
The usual approach I've seen is not to distinguish strict and lazy
datatypes, but rather to distinguish strict and lazy functions, e.g. by
having two different arrows: (-) for lazy functions and (!-) for strict
On Sun, Mar 7, 2010 at 3:44 PM, George Colpitts
george.colpi...@gmail.com wrote:
/usr/bin/hsc2hs: line 16: unexpected EOF while looking for matching `'
/usr/bin/hsc2hs: line 17: syntax error: unexpected end of file
Sounds like a problem with hsc2hs itself.
When I installed ghc on Snow Leopard
On Wed, Mar 3, 2010 at 6:15 AM, Ivan Miljenovic
ivan.miljeno...@gmail.com wrote:
On 3 March 2010 16:11, Tom Hawkins tomahawk...@gmail.com wrote:
-Wall only complains about shadow bindings, defined but not used, and
no type signature. But no unmatched patterns.
Yes it does: one of the options
On Wed, Mar 3, 2010 at 6:30 PM, Thomas DuBuisson
thomas.dubuis...@gmail.com wrote:
On Wed, Mar 3, 2010 at 10:26 AM, Pradeep Wickramanayake prad...@talk.lk
wrote:
getItemFile :: IO String
This says getItemFile is an action that returns a string. No arguments.
getItemFile test = ...
And
On Sat, Feb 27, 2010 at 9:29 AM, Brandon S. Allbery KF8NH
allb...@ece.cmu.edu wrote:
On Feb 27, 2010, at 04:07 , zaxis wrote:
xxxMain = do
timeout - getEnv xxx_TIMEOUT
case timeout of
Just str | [(t, _)] - reads str - do
addTimeout t (hPutStrLn stderr *** TIMEOUT _exit
On Tue, Feb 23, 2010 at 1:08 AM, Paul Brauner paul.brau...@loria.fr wrote:
Hello,
I remember seeing something like
typedata T = A | B
somewhere, where A and B are type constructors, but I can't find it in
the ghc doc. Have I been dreaming or is it some hidden feature ?
Paul
On Wed, Feb 24, 2010 at 1:24 PM, Christian Maeder
christian.mae...@dfki.de wrote:
1. break the line after do
(to avoid a layout change when change name or arguments of float' or
rename the variable e)
You can also break it immediately before do, which I think is
sometimes more clear.
2010/2/21 Vojtěch Knyttl kny...@gmail.com:
Hello,
I am trying to create STArray with newListArray like this:
la x y = newListArray ((1,1),(x,y)) [(x'+y') | x' - [1..x], y' - [1..y]]
– but it does not work:
No instance for (MArray a Field m)
Notice that newListArray has a monadic return
On Sun, Feb 21, 2010 at 7:10 PM, Max Bolingbroke
batterseapo...@hotmail.com wrote:
You might be able to get somewhere by writing a custom main function
in C and linking it in. According to
http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html
if a lib specified with the -l
I can't answer your question (about getting minBy into the libraries)
but I thought I'd point out some tricks:
On Sat, Feb 20, 2010 at 10:47 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
Also, constructions like
sortBy (compare `on` foo)
must surely be very common.
Common enough
On Thu, Feb 18, 2010 at 8:07 AM, Evan Laforge qdun...@gmail.com wrote:
And BTW again, here's something I've occasionally found useful:
-- | Handy to merge or sort a descending list.
reverse_compare :: (Ord a) = a - a - Ordering
reverse_compare a b = case compare a b of
LT - GT
EQ - EQ
On Fri, Feb 5, 2010 at 5:51 PM, Chris Eidhof ch...@eidhof.nl wrote:
Approach 2: I installed the 'download-curl' package, and tried again. This
seems to fail on the following example:
import Network.Curl.Download
main = do x - openURI http://haskell.org;
y - openURI
On Wed, Feb 3, 2010 at 1:10 PM, Alexander Treptow
alexander.trep...@googlemail.com wrote:
testFunc :: (forall a. Conf a, MonadIO m = m a) - TestType
At a guess, this function takes a tuple containing a forall a. Conf a
and a MonadIO m = m a, which is not what you meant. As Miguel says,
more
On Wed, Dec 16, 2009 at 2:55 PM, Daniel Fischer
daniel.is.fisc...@web.de wrote:
unCamel :: String - String
unCamel ('':cs) = '' : inTag cs
unCamel (a:b:c:cs)
| isLower a isUpper b isLower c = a : '_' : toLower b : c : unCamel
cs
unCamel (a:bs@(b:cs))
| isLower a isUpper b = a :
On Sat, Dec 12, 2009 at 10:08 AM, Maciej Piechotka
uzytkown...@gmail.com wrote:
If operation is associative it can be done using divide et impera
spliting list in half and operating on it pararerlly then split in half
etc.
I implemented something like this as an exercise:
On Sun, Nov 22, 2009 at 7:13 PM, Ketil Malde ke...@malde.org wrote:
E.g. if module Foo.Bar isn't found in Foo/Bar.hs GHC could look in
Foo.hs (which would just contain a concatenation of what would currently
reside in Foo.hs and Foo/Bar.hs).
The obvious question arising here is what if module
On Tue, Nov 24, 2009 at 11:11 PM, zaxis z_a...@163.com wrote:
I cannot hoogle it. It appears in Pugs:
run' (-d:rest) = do
info - fmap Just (io $ newTVarIO Map.empty)
let ?debugInfo = info
run' rest
Sincerely!
-
fac n = foldr (*) 1 [1..n]
--
View this
It looks quite neat to use the Maybe monoid here:
import Data.Monoid
searchList p = foldr (\x - if p x then mappend (Just [x]) else id) Nothing
but it seems that the Maybe Monoid instance keeps this strict. I
fiddled with this a bit, and came up with the following:
instance (Monoid m) =
On Tue, Nov 10, 2009 at 5:04 AM, Philippos Apolinarius
phi50...@yahoo.ca wrote:
foreign import ccall rs232.h opencport opencport :: CInt - IO ()
foreign import ccall rs232.h closecport closecport :: CInt - CInt
[...]
Originally, I had the following line (that did not work properly):
On Wed, Nov 11, 2009 at 6:00 PM, Philippos Apolinarius
phi50...@yahoo.ca wrote:
closecport :: Int - IO Int
closecport n= return (fromIntegral (c_closecport (fromIntegral n)))
The return here doesn't do what you think it does - semantically, the
value of c_closecport is still considered pure
Oops, I clicked reply instead of reply to all. Duplicating the
message below.
I suppose this means someone is going to get two copies of this. Sorry someone!
On Thu, Nov 5, 2009 at 12:56 AM, Ben Millwood hask...@benmachine.co.uk wrote:
On Wed, Nov 4, 2009 at 10:21 PM, Torsten Otto t-otto-n
91 matches
Mail list logo