Hi Sergey,
You wrote:
Suppose I want show Nothing to return "", and show (Just foo) return
show foo. I don't seem to be able to. Looks like I either have to use
some other function name, like `mShow'
That is correct.
Show instances are supposed to follow the convention that
"show x" is a Hask
Nicolas Frisby wrote:
I've always thought that when certain operations are of particular
interest, it's time to use more appropriate data structures, right?
Lists are great and simple and intuitive, but if you need such
operations as shifts, something like a deque is the way to go.
This sounds
J. Garrett Morris wrote:
This is where my favorite part of the mtl steps in: monad transformers.
I agree, the Error monad is very helpful here.
First, we'll create a transformed version of the IO monad,
Why go to the trouble of creating a new monad?
The existing ones are fine.
(While writi
Andrew Wagner wrote:
I've got several problems which seem to have a very similar structure.
I want to find a way to abstract them to solve other problems which
can be thought about in the same way. Here they are:
http://hpaste.org/307
http://hpaste.org/308
http://hpaste.org/309
Note that these a
I wrote:
Why go to the trouble of creating a new monad?
The existing ones are fine.
J. Garrett Morris wrote:
Mainly to keep the type error messages simpler.
There are two ways to get around that problem:
1. Make your functions polymorphic, using
MonadState, MonadError, etc. Each function
me
I wrote:
Cale Gibbard's MonadRandom... I would like to suggest
a change to the interface...
class (Monad m) => MonadRandom m where
nextR :: m Int
splitR :: m (m ())
rangeR :: m (Int, Int)
getR :: (forall g . RandomGen g => g -> a) -> m a
I see that I have inadvertently done two things
d
apfelmus wrote:
I'm unsure whether it's a good idea to simulate
the situations, I'd prefer a more denotational
approach...
Queuing theory is a very large and mature area of
research, with many important applications in
industry. It is not a coincidence that a certain
telephone company named a
J. Garrett Morris wrote:
Again, from the earlier example, I'm not sure how typing:
apply :: (MonadCont m, MonadState Blargh m, MonadError Fzzt m, MonadIO m) =>
Handle -> Attribute a -> m a
is simpler than
apply :: Handle -> Attribute a -> m a
Well, no, but it is at least no worse than
app
Philippe de Rochambeau wrote:
I have tried
map (putStrLn) pImpliesQAndRLoopShow
but that results in the following error message:
Try
mapM_ putStrLn pImpliesQAndRLoopShow
or
putStrLn $ unlines pImpliesQAndRLoopShow
Regards,
Yitz
___
Haskell-Cafe ma
Aaron McDaid wrote:
Apologies for referring to this old thread...
At least for me, this is not old. It is still very
much on my mind.
Simply, 'undefined >> undefined' is a bit more defined than simply
'undefined'. Just like 'undefined:undefined' is at least a non-empty
list; which can be matc
Just for the record, I think this completes the
requirements of my challenge. Please comment!
Is this correct?
Thanks.
1. Find a way to model strictness/laziness properties
of Haskell functions in a category in a way that is
reasonably rich.
We use HaskL, the category of Haskell types, Haskell
Mikael Johansson wrote:
A way to categorify elements of objects in a
cartesian closed category (such as that that
sufficiently restricted Haskell takes place in)
are to view entities of type A as maps () -> A.
Dan Weston wrote:
This rather inconveniently clashes with the fact that
A and () -
OK, thanks!
Regards,
Yitz
Cale Gibbard wrote:
The splittable idea isn't mine, it looks like perhaps Remi Turk did it.
One thing which I'd recommend is including getRandom, getRandomR as
implemented in terms of getR and the ordinary random operations,
simply because they're the two most common
Aaron McDaid wrote:
Could seq be changed so that it will not give an
error if it finds undefined?
The definition of seq is that seq _|_ x = _|_. That is
what it is supposed to do.
Actually, the behavior of seq on undefined is very
tame - it raises an exception which can be caught.
Sometimes se
Lennart Augustsson wrote:
I think seq is funny because it is not lambda definable.
Does the set of computable functions on the natural
numbers defined by the lambda calculus augmented
with seq have higher Turing degree than the
set of classical computable functions?
-Yitz
_
Hi Vishy,
You wrote:
I have just started on my journey in learning Haskell.
Welcome aboard! We all wish you an enjoyable and
(type)safe trip.
I have started off reading wikibook, then will read yet
another tutorial on haskell. Please guide
me if I am on right track
Those are both great tut
Lennart Augustsson wrote:
I think seq is funny because it is not lambda definable.
I wrote:
Does the set of computable functions on the natural
numbers defined by the lambda calculus augmented
with seq have higher Turing degree than the
set of classical computable functions?
I guess I was no
Hi,
I would like to use FFI for the first time. Can someone
give me a really, really simple complete example?
I want to be able to take a simple C program and
access a function from it in Haskell. A simple example
of the other way around would be nice, too, but I
don't happen to need that just n
Thanks to everyone for all the help! Everything
is working for me now. It turns out that the main
detail I was missing was exactly what commands
to type to compile it, and how to use it in GHCI.
Pretty important detail, actually.
Alistair - yes, there are a few simpler pages about
FFI on the old
Bulat Ziganshin wrote:
examples of lifting C functions into Haskell world:
mysin :: Double -> Double
mysin = realToFrac . c_mysin . realToFrac
-- c_mysin :: CDouble -> CDouble
rnd :: Int -> IO Int
rnd x = do r <- c_rnd (fromIntegral x)
return (fromIntegral r)
-- c_rnd :: CInt -> IO
[EMAIL PROTECTED] wrote:
Still, in the interest of purity, here it is, in
Haskell. As the original Eratosthenes sieve,
this algorithm uses only successor and
predecessor operations.
I don't think the Greeks had too much trouble with
addition. If that is the case, then Rafael's
definition is st
Lennart Augustsson wrote:
I'm not sure what you're asking. The (untyped) lambda calculus is
Turing complete.
How could seq improve that?
Obviously, it can't. But how can it hurt?
Classical lambda calculus does not model the
semantics of laziness, so seq is equivalent to
flip const there, just
Besides memoizing, you might want to use the fact
that:
fib (2*k) == (fib (k+1))^2 - (fib (k-1))^2
fib (2*k-1) == (fib k)^2 + (fib (k-1))^2
Regards,
Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/has
Hi Marc,
Marc Weber wrote:
class (Monad m) => GetMV m a where
...
instance GetMV m c where (2)
...it would be save to assume that the programmer doesn't want a
failure but success.
Thus ghc could infer (3) automatically but doesn't
The Monad m on the class declaration
I wrote:
The other way is if the type is
not fully specified - it is a variable - then you can
"pass the buck" and say that whoever uses this
instance must first make sure that the value of
the type variable is a type that already has a
Monad instance.
In this case, you are creating an obligati
David Tolpin wrote:
could you please point me to a reference
(paper/note/something else) that explains
that class constraint in a class definition
is a guarantee with regard to a type declaration
but a requirement with regard to an instance
declaration?
Sebastian Sylvan wrote:
Well, I guess th
Simon Peyton-Jones wrote:
Yitz, Please do make time to do this!
This is the moment, while it is still fresh in your mind.
Of course, you are correct. Thanks for the push.
I am a bit busy with work, but the information is not
lost. I'll have it up soon.
Regards,
Yitz
___
Hi Melissa,
I enjoyed your article. I especially like your trick
of starting with p*p.
You wrote:
Which seems reasonable, until you realize that every
prime p we come up with is still "considered" by
k deleteOrd filters, where k is the number of primes
that preceeded it.
It is true that I hav
Hi Melissa,
You wrote:
- Eratosthenes's sieve never says the equivalent of, "Hmm, I
wonder if 19 is a multiple of 17" -- but both the basic "sieve" we
began with and the deleteOrd version do
So then maybe I taught my daughter the wrong thing.
When she does 17, she moves ahead one number at
Hi Alfonso,
You wrote:
Could not deduce (Synchronous s f11)
from the context (Synchronous s f1)
\begin{code}
class Synchronous s f1 where
mapSY :: f1 a b -> s a -> s b
delaySY :: a-> s a -> s a
sourceSY :: f1 a a -> a-> s a
sourceSY f s0 = o
Tom Hawkins wrote:
Any recommendations for speeding up extracting
the set of leaves from a tree?
Tom,
The standard library already has this, in Data.Tree
and Data.Foldable.toList.
I'm interested to know how well that performs compared
to the roll-your-own solutions proposed so far in this
thr
Hi Iliali,
You wrote:
Hi I am trying to implement the function drop in haskell
Chris Eidhof wrote:
you're almost there...
In case this is homework, you may also want to
look at:
http://www.haskell.org/haskellwiki/Homework_help
Regards,
Yitz
___
Thomas Hartman wrote:
Is there a way to do
as a shell command that idiomatically uses haskell?
I used to do those in Perl, too, years ago.
I switched to the readable step-by-step style of the
Python shell when I moved from Perl to Python.
It is a whole different mentality about how to wor
\begin{code}
kmin :: Ord a => Int -> [a] -> [Int]
kmin k x = map snd $ Set.toList $ foldl' insertIfSmall (Set.fromList h) t
where
(h, t) = splitAt k $ zip x [0..]
insertIfSmall :: Ord a => Set.Set a -> a -> Set.Set a
insertIfSmall s e
| e < mx= Set.insert e s'
| otherwise = s
where
(mx
\begin{code}
kmin :: Ord a => Int -> [a] -> [Int]
kmin k x = map snd $ Set.toList $ foldl' insertIfSmall (Set.fromList h) t
where
(h, t) = splitAt k $ zip x [0..]
insertIfSmall :: Ord a => Set.Set a -> a -> Set.Set a
insertIfSmall s e
| e < mx= Set.insert e s'
| otherwise = s
where
(mx
Back to the original problem for a moment.
\begin{code}
import qualified Data.Sequence as Seq
import Data.Sequence ((|>), ViewL((:<)))
weave :: [[a]] -> [a]
weave = weaveSeqL . Seq.viewl . Seq.fromList
where
weaveSeqL ((x:xs) :< s) = x : weaveSeqL (Seq.viewl $ s |> xs)
weaveSeqL _
Ruben Zilibowitz wrote:
What does it mean if I'm trying to check out a darcs repository and I
get the following error?
darcs: ./.DS_Store: openBinaryFile: does not exist (No such file or
directory)
If you are doing "darcs get" from a partial repo and you
did not use --partial, then this sounds
DavidA wrote:
What I mean is, it seems like good design would mean that you could write and
test the game logic totally independently of any IO. Game functions such
as "makeMove" ought to have type signatures that don't involve any IO. Can this
be achieved in option 2?
Here is one way:
For fun
Border conditions in the Haskell Library
have finally made the mainstream media:
http://www.cnn.com/2007/US/05/26/border.quirk.ap/index.html
-Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-ca
Tom Ellis wrote:
> Shouldn't it be an *Applicative* constraint?
>
> class Applicative t => ApplicativeIO t where
> liftIO :: IO a -> t a
>
> and require that
>
> liftIO (pure x) = pure x
> liftIO (f <*> x) = liftIO f <*> liftIO x
>
> Seems like ApplicativeIO makes more sense tha
Dan Burton wrote:
> From what you've said, it sounds like you can already write:
>
> serverSide :: IO a -> Form a
>
> This seems elegant enough to me for your needs. Just encourage it as an
> idiom specific to Forms.
>
> myBlogForm = Blog <$> titleForm <*> serverSide getCurrentTime <*>
> co
Project Euler is excellent, lots of fun, and rewarding.
Thanks to Daniel and all the other members of the team.
Project Euler problems, by their nature, also happen
to be excellent material for teaching and learning Haskell.
Having various solutions to them on the wiki is a
valuable resource for t
Sebastian Sylvan:
>> featureGenNormal = do
>> id <- stringGen
>> name <- stringGen
>> featuretype <- arbitrary
>> grouptype <- arbitrary
>> children <- arbitrary
>> properties <- listGen stringGen
>> return (Feature id name featuretype grouptype children properties)
Rya
Matthew Pocock wrote:
> I've been using monad transformers for the first time in anger this week.
I hope your enjoyment in using monads has helped your anger
to subside. :)
> ...there's an operation that I keep defining over
> and over again...
> hoistList :: (Monad m) => [a] -> ListT m a
>
On Fri, Mar 28, 2008 at 4:26 AM, Anton van Straaten wrote:
> I want to unescape an encoded XML or HTML string, e.g. converting "
> to the quote character, etc.
> Since I'm using HaXml anyway, I tried using xmlUnEscapeContent with no
> luck
Hi Anton,
I only noticed your post today, sorry for th
Alexander Kireyev wrote:
> While trying to write a program for the countPaths Code Jam problem I
> ran into what seems to me as a weird behaviour in terms of memory
> allocation...
> The profiling log (./paths +RTS -P) shows the following time/space
> behaviour for them...
Hi Alexander,
I'm
Max Desyatov wrote:
>> I'm interested in working on a library for a stateful web browsing in
>> Haskell during Google Summer of Code.
Thomas Schilling wrote:
> Also, for a GSoC proposal you should try to convince the mentors, why your
> project is useful for Haskell in general. So maybe you have
Antonio Regidor García wrote:
> I'm trying to implement an alarm in Haskell and wrote the following code:
> http://hpaste.org/7201
> But it doesn't work as expected.
Hi,
The getLine function ties up stdin. So the system function isn't
able to proceed until getLine completes, even when it is in
Andrew Coppin wrote:
> I offer up the following example:
>
> mean xs = sum xs / length xs
>
> Now try, say, "mean [1.. 1e9]", and watch GHC eat several GB of RAM. (!!)
>
> If we now rearrange this to
>
> mean = (\(s,n) -> s / n) . foldr (\x (s,n) -> let s' = s+x; n' = n+1 in s'
> `seq` n' `s
Brandon S. Allbery KF8NH wrote:
> Adjacent different scripts in general is probably a reasonable token
> discriminator. A "token" combining LTR and RTL, for example, is just
> confusing.
So you would like to ban identifiers that contain both
letters and digits for those who happen to speak langua
Brandon S. Allbery KF8NH wrote:
> Come to think of it, if you're after math notation, enough Greek letters are
> used as symbols that it might be necessary to just exclude them from use as
> letters.
While I have not yet noticed anyone from Greece on this list,
I don't think it would be appropriat
Brandon S. Allbery KF8NH wrote:
>>> Come to think of it, if you're after math notation, enough Greek
>>> letters are used as symbols that it might be necessary to just
>>> exclude them from use as letters.
Yitz Gale wrote:
>> While I have not yet noticed anyone from Greece on this list,
>> I don't
Don Stewart wrote:
> You'd want a general fusion framework for this...
> Stream fusion... at least does this for zips...
> but for an arbitrary 'f' instead of zip,
> seems harder.
And of course, you wouldn't want that:
f xs = xs : map expensiveCalculation xs
Please don't fuse those two loops int
Alistair Bayley wrote:
>> A couple of days ago I had need for:
>> concatM :: Monad m => [m [a]] -> m [a]
>> concatM = liftM concat . sequence
>> but found no such thing in the std libs
It used to be in an older version of Haskell, but
it was removed in Haskell 98.
Bulat Ziganshin wrote:
> 2. it's
Alistair Bayley wrote:
>> concatM :: Monad m => [m [a]] -> m [a]
>> concatM = liftM concat . sequence
Miguel Mitrofanov wrote:
> Seems to be close to
> sequence :: [ListT m a] -> ListT m a
> Hmm?
Yes. It is close to something like that for the old
broken ListT - but let's not talk about that one.
Hi Bulat,
Bulat Ziganshin wrote:
> if main part of your program is GUI - it's better to stick with C# and
> all its visual bells and whistles. the only good thing with gtk2hs is
> that you got Linux portability for free. actually, people will think
> that you have developed it on linux and ported
Thomas Hartman wrote:
> I would be interested in seeing good motivating examples for use of
> the state monad...
> Okay, it's good for randomness. What else?
> ...I saw an example about
> using state to uniquely label elements of a tree
> So, are there any other simple motivating examples that show
Krasimir Angelov wrote:
>> but notice that the set is still traversed twice.
Neil Mitchell wrote:
> I don't see any way of reducing that
Yeah, it looks like the Data.Set (and Data.IntSet) library
is missing the functions
insertMember :: Ord a => a -> Set a -> (Bool, Set a)
deleteMember :: Ord a
Adam Smyczek wrote:
> data SampleType = A | B Int | C String | D -- etc.
> sampleTypes = [A, B 5, C "test"] :: [SampleType]
> How do I find for example element A in the sampleTypes list?
There have been many useful replies. But since Adam
originally announced that this is a "beginner question
David Overton wrote:
> Also, see my recent attempts at (constraint) logic programming in Haskell:
> http://overtond.blogspot.com/2008/07/pre.html
> http://overtond.blogspot.com/2008/07/haskell-sudoku-solver-using-finite.html
See the Sudoku page on the wiki:
http://www.haskell.org/haskellwiki/Sudo
I wrote:
>> ...there must be some
>> way to control the import and export of instances, just as we can
>> now control the import and export of every other kind of symbol
>> binding.
Henning Thielemann wrote:
> For me it's most often the case that an instance is missing.
> If there is no way to c
John D. Ramsdell <[EMAIL PROTECTED]> wrote:
> I tried to replace a permutation generator with one that generates
> each permutation from the previous one, in a stream-like fashion. I
> had hoped the stream-based algorithm would be more efficient because I
> use only one permutation at a time, so o
Alfonso Acosta wrote:
> I haven't tried to run the code, but my first bet is that, due to the
> rank-2 polymorphism of ST, you should use parenthesis instead of $ in
> the case of runST.
Perhaps if Andrew is using an old compiler.
That is no longer a problem in recent versions of GHC.
A more basi
I wrote:
>> A more basic issue is that fn is in the IO monad,
>> but its use inside the mapM will need it to be in the ST
>> monad.
Daniel Fischer wrote:
> No,
> return (fn particle) :: ST s (IO ())
> , so that's fine.
Ah, true. But I doubt that Andrew really meant to
do the calculation in ST s (
Sigbjorn Finne wrote:
> the first public release of hs-dotnet is now available
Fantastic accomplishment! I can only repeat dons' comment
- this could be game-changing.
Some obvious questions that come to mind:
We see that it is already possible to expose a Haskell function
to .NET as a callback.
Sukit Tretriluxana:
> I was looking around Stroustrup's website and found
> a simple program... I wondered how a Haskell
> program equivalent to it looks like...
> main = E.catch (interact reverseDouble) (\_ -> print "format error")
> toDoubles = map (read::String->Double)
For a "safe" p
Duncan Coutts wrote:
> We want to let random users on random
> platforms submit simple anonymous build reports (no logs)...
> The only downside compared to a more centralised system is that we do
> not get to centrally monitor the status of the dedicated build clients.
And that we open ourselves u
Duncan Coutts wrote:
>>> let random users... submit... build reports...
I wrote:
>> ...we open ourselves up to... hostile build reports and DOS.
Manlio Perillo wrote:
> DOS is always a problem, for every application open to the Internet.
Yes. But I didn't mean just generic flooding. I meant
abus
Duncan Coutts wrote:
> Detailed build reports with logs are not anonymous, clients will need an
> account on hackage (ie username and password).
Right. If we experience problems with that in the future,
we just have to make sure that it won't be too hard
to set up captcha.
> they'll either be obv
Jeff,
I'm not sure if this is causing the problem you're referring to,
but MacPorts is at GHC 6.10 while Gtk2Hs doesn't support
that yet.
Regards,
Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskel
Both of the points raised by Malcolm are a matter of
personal preference, in my opinion. In fact, my own
preference is the opposite of Malcolm's in both cases.
Both of Malcolm's suggestions would rob me of filtering
capability.
Malcolm Wallace wrote:
> I would suggest that posting announcements *o
Duncan Coutts wrote:
>> This was uploaded to hackage yesterday:
>> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HDBC-mysql-0.1
This is wonderful news! Whatever we might say about MySQL,
it is so ubiquitous that this driver is really important for Haskell.
Chris, please keep us up-to-
Chris Waterson wrote:
>> You probably already know this, but... you can
>> mix tables from different storage engines in a
>> single *statement*.
Oh, no, I thought it was per database. Horrors!
>> ...when a ROLLBACK has been issued
>> against a non-transactional table... I could raise an
>> error.
Duncan Coutts wrote:
>>> So in the next cabal-install release (which should be pretty soon now)
>>> configure will do the same thing and pick base 3 unless you specify
>>> build-depends base >= 4.
Niklas Broberg wrote:
>> I really really think this is the wrong way to go. Occasional
>> destruction
Thomas Davie wrote:
>>> This is caused by OS X's libiconv being entirely CPP
>>> macros, the FFI has nothing to get hold of.
>>> IIRC there's a ghc bug report open for it.
Judah Jacobson wrote:
> The OS X system libiconv is actually OK; it's the MacPorts libiconv
> that has the CPP macros...
> Tha
Manlio Perillo wrote:
> The first difference is about a `mod` b, when a and b are Float types.
> Python use the fmod function, and it also implement divmod; Haskell seems to
> lack support for this operation.
Yes, Haskell does not implement the full IEEE. There are
differing opinions about that: s
Manlio Perillo wrote:
>> The first difference is about a `mod` b, when a and b are Float types.
>> Python use the fmod function, and it also implement divmod; Haskell seems to
>> lack support for this operation.
I wrote:
> Yes, Haskell does not implement the full IEEE.
I spoke too soon. Data.Fixe
Manlio Perillo wrote:
>> fac(777) / fac(777)
>>> 1.0
>>> Here CPython does not convert the two integers to float before to divide
>>> them, but make use of a special algorithm.
>>> GHC, instead, returns NaN
I wrote:
>> No, actually here Haskell shines. Perhaps this GHCi session
>> will illumin
Manlio Perillo wrote:
> No.
> I'm looking for...
Manlio - can you describe exactly what you want?
Do you know exactly what you want?
You have said that you want division like in Python -
but that even that is not well defined:
Python 2.6.1
>>> 3/5
0
Python 3.1
>>> 3/5
0.59998
Pleas
Manlio Perillo wrote:
> However there is still a *big* problem: it is inefficient.
>
> Here is a Python version of the Chudnovsky algorithm [1] for computing Pi:
> http://paste.pocoo.org/show/102800/
> On my system it takes 10 seconds.
> Here is an Haskell version:
> http://paste.pocoo.org/show/102
Manlio Perillo wrote:
>> I'm looking for an exact integer division that avoids overflows, if
>> possible.
Richard O'Keefe wrote:
> What this sounds like to me is a request that the Prelude
> function 'fromRational' should work well...
> If you cannot divide two Integers n, d accurately using
> (
Manlio Perillo wrote:
> By the way, in GHC.Float there is a (private):
> integerLogBase :: Integer -> Integer -> Int
Yes, I have needed this function many times.
Too bad it is not exposed.
In this case, though, we only need base 2.
For that, it would be nice if we could just read
it directly from
Peter Verswyvelen wrote:
> I do have asked myself the question whether a "really random generating"
> function could be regarded as "pure" somehow
Not really. Somewhere in your program you are likely to make
the assumption that a value you obtained, however indirectly,
from this function will be t
Peter Verswyvelen wrote:
>>> I do have asked myself the question whether
>>> a "really random generating"
>>> function could be regarded as "pure" somehow
I wrote:
>> Not really...
Alberto G. Corona wrote:
> What is pure randomness? .When the algorithmic complexity of the list of
> random number
Hi Manlio,
Manlio Perillo wrote:
> For my Netflix Prize project I have implemented two reusable modules.
> The first module implements a random shuffle on immutable lists...
> The second module implements a function used to partition a list into n
> sublists of random length.
Very nice!
> If som
I spoke to a faculty member in a decent Computer Science
department in which no one has ever done anything
related to FP. (You may say that is an inherent contradiction,
but what can I do, the department does have a good
reputation. I am withholding names to protect the
innocent.)
This faculty mem
Melanie_Green writes:
>> I want to use listcomprehension to output the pattern below...
Jón Fairbairn wrote:
> Why do you want to use list comprehensions?
> What if they aren't the best way of getting the
> result you want?
unlines . tail . inits . repeat $ 'a'
> concat [replicate n 'a' ++ "\n"
I wrote:
>> I would like some links that would give such a person
>> a nice overview of the various active areas of
>> FP-related research these days...
Bernie Pope wrote:
> Some ideas off the top of my head...
Thanks, that's exactly what I was looking for.
Also, thanks to Sean for suggesting the
Manlio Perillo complained about:
>> buildPartitions xs ns = zipWith take ns . init . scanl (flip drop) xs $ ns
Miguel Mitrofanov wrote:
> takeList = evalState . mapM (State . splitAt)
Ha! Bravo!
As the author of the offending zipWith/scanl version,
I can say that love those State monad one-liner
Miguel Mitrofanov wrote:
>>> takeList = evalState . mapM (State . splitAt)
I wrote:
>> However, ironically, I stopped using them for pretty
>> much the same reason that Manlio is saying.
Dan Piponi wrote:
> Are you saying there's a problem with this implementation? It's the
> only one I could jus
Jason Dagit wrote:
> Looks like the repo [1] for the OpenAL bindings that Sven Panne
> created [2] is no longer available. I assume this is a result of The
> Great Server Outage of 2011 [3].
> [1] http://darcs.haskell.org/packages/OpenAL/
> [2] http://hackage.haskell.org/cgi-bin/hackage-scripts/pac
Bas van Dijk wrote:
> What's the recommended way for serializing (with the cereal package) an
> UTCTime?
Serialize the Day part as an Integer using
toModifiedJulianDay/ModifiedJulianDay,
(Note that Day is not a constructor, it's just the name of
the type.)
Serialize the DiffTime as a Rational, a
Yves Parès wrote:
>> Is there some litterature expliciting in a less empiric way than I did the
>> differences like this between data and newtype? I've never come against
>> such documentation through all my learning of Haskell, yet I think it's an
>> important point.
Roman Cheplyaka wrote:
> See
Pēteris Paikens wrote:
> I'm stuck at trying to get Data.Encoding package functional. Cabal
> gives the following error message:
This is caused by a problem with the cabal file in the encoding
package. Often it causes the entire GHC package system to
get confused, as pointed out by Brandon.
The
Johan Tibell wrote:
> If Chris is indeed out of the loop we should find a new maintainer.
> Mark and I are also interested in the future of protocol buffers in
> Haskell.
Also, Chris is the maintainer of some regex packages
that are in the Haskell Platform.
-Yitz
Bryan O'Sullivan wrote:
> A substantial number of the difficulties I am encountering are related to
> packages specifying upper bounds on their dependencies. This is a recurrent
> problem, and its source lies in the recommendations of the PVP itself
I think the PVP recommendation is good, though a
Adde Nilsson wrote:
>>> Ok, do you know of any way to add/subtract without converting to UTC and
>>> back?
Brandon Allbery wrote:
>> I'm not sure I'd do that in any environment, since usually libraries don't
>> deal with the result crossing a daylight/summer time change (and those that
>> do, surp
Hi David,
David Thomas wrote:
> https://github.com/dlthomas/tzcache
> A small bit of code, but seems likely to be useful enough that I figured I
> should share.
>
Thanks for sharing this!
> 1) Does this already exist somewhere I missed?
>
I haven't seen it anywhere.
> 2) It seems silly to m
Johan Tibell wrote:
> I suggest that we implement an alternative haddock syntax that's a
> superset of Markdown.
Here is a previous thread on this exact topic, from five years ago:
http://www.haskell.org/pipermail/haskell-cafe/2008-February/039846.html
It mentions a few additional shades of bike
The mailman daemon process on the server apparently exited
for some reason. I restarted it, and now mail traffic seems to be
going through normally again.
-Yitz
On Sun, May 12, 2013 at 9:21 PM, Carter Schonwald
wrote:
> I've had this problem too. Was trying to sign up for the llvm HS lib list
>
301 - 400 of 522 matches
Mail list logo