Bjorn Bringert wrote:
Here's a much more inefficient version, but it has the merit of being
very easy to understand:
tm_silly n = length $ takeWhile (=='0') $ reverse $ show $ product [1..n]
Be careful with types - use Data.List.genericLength
here instead of length. Otherwise, tm_silly n is
I wrote:
Be careful with types - use Data.List.genericLength
here instead of length. Otherwise, tm_silly n is wrong for
n = 13 (on my 32-bit machine) due to round-off error
in the Int type.
Are you sure you really tested tm_silly ?
length is perfectly enough
to count the 0 in n! since the
Hi Manu,
You wrote:
After reading Peter Norvig's take on writing a Sudoku solver
(http:// norvig.com/sudoku.html)
I decided that I would port his program to Haskell, without changing
the algorithm, that'll make a nice exercise I thought
and should be fairly easy... Boy, was I wrong !
Manu wrote:
Should I introduce more strictness ? replace lists with more
efficient data structures (ByteStrings, Arrays) ?
Derek wrote:
Yes. Treating lists like arrays is always a recipe
for heartbreak.
Here it costs very little - the lists are all short, mostly of
length exactly 9.
If
I wrote:
Perhaps you would gain something if you used Data.Map.!
instead of your lookup.
Manu wrote:
I'm not sure I understand, do you mean I should have use a strict Map
constructor ?
like : Map !key !value ?
No, there is an operator in Data.Map called !.
how can it replace the lookup
David Carter wrote:
Prelude let sqlist = map sq
...
Prelude sqlist [2.5]
interactive:1:8:
No instance for (Fractional Integer)
... etc
Isaac Dupree wrote:
The dreaded Monomorphism Restriction...
You could... use `ghci -fno-monomorphism-restriction`.
...it's good to know the
While playing with @pl on #haskell, I noticed some
weird and surprising lambda identities. For example:
let {c = (.); c4 = c c c c}
Then we have:
c c4 == c c4 c c c c
Proof: Repeatedly apply the identity:
(*) x (y z) == c x y z
More stuff:
c c2 == c4, c c3 == c7, but c cn does not appear
to
apfelmus wrote:
Is there a way to automate ghci ... EnableGUI -framework Carbon and
typing enableGUI at the first prompt?
I have the following in my .ghci file:
-- Read GHCI commands from the file whose name is
-- in the GHCIRC environment variable
:def _load
I wrote:
And flip is (essentially) the B combinator.
Oops, the C combinator.
-Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Michael Vanier wrote:
Is there an implementation of a symbol type in Haskell i.e. a string which
has a constant-time comparison operation?
Stefan O'Rear wrote:
Yes, I beleive GHC uses one (utils/FastString.lhs iirs)
In some cases where you would need that in other languages,
you would use an
Dan Piponi wrote:
The reusability of Num varies inversely with how many
assumptions you make about it.
A default implementation of pi would only increase usability,
not decrease it.
If you need a specialized definition of pi in your instance,
you would provide it, just as you do now.
If pi
Michael Vanier wrote:
I'm thinking of a symbol type that can be used
for a compiler...
Ah. Perhaps Data.HashTable is what you are looking
for then?
-Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I wrote:
Perhaps Data.HashTable is what you are looking
for then?
Jerzy Karczmarczuk wrote:
extract from Data.Hash what you need...
why not try tries?
apfelmus wrote:
There's always Data.Map
Those are log n. I would personally use those for
almost every application, but Mike says he wants
Andrew Coppin wrote:
Is there a way to get rid of . and .. in the results?
Brandon S. Allbery wrote:
Manual filtering is always required, whether C, Perl, Haskell, etc.
I dunno, maybe python filters them for you or something.
Correct, Python filters them out. This is clearly the correct
I wrote:
...a tool for recursing through directories...
How about a built-in function that represents a directory tree
as a lazy Data.Tree?
Bryan O'Sullivan wrote:
See System.FilePath.Find in
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.2
Not a very good idea.
I wrote:
How about a built-in function that represents a directory tree
as a lazy Data.Tree?
Jules Bean wrote:
Please no.
The last thing haskell needs is more dangerous semantically broken
non-referentially-transparent lazy IO structures.
Agreed. I would definitely not want it to be a
I wrote:
...a tool for recursing through directories...
How about a built-in function that represents a directory tree
as a lazy Data.Tree?
Bryan O'Sullivan wrote:
See System.FilePath.Find in
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.2
-- List all directories
Hi Ian, thanks for responding to my plea!
I am renaming this thread and moving it to libraries.
Please respond there.
I wrote:
http://haskell.org/haskellwiki/ListT_done_right
and not the broken implementation that comes with mtl.
(Finally fixed in 6.8? Please?)
Ian Lynagh wrote:
If you want
Hi apfelmus,
I wrote:
...a tool for recursing through directories...
How about a built-in function that represents a directory tree
as a lazy Data.Tree?
-- List all directories in the tree rooted at the given path
traverseDirectories :: MonadIO m =
TraversalDirection - FilePath - ListT m
Hi Bryan,
You wrote:
This is little different from the approach taken by Python's os.walk,
which lazily yields the contents of a directory tree as it traverses it.
I'm a little unclear on why one appears good in your eyes, while the
other is not, beyond perhaps the depth/breadth knob and
David Menendez wrote:
If desired, we could easily define a class for commutative monads, and
then state that ListT m is only a monad if m is a commutative monad.
If we do that, can I suggest that we use some name other
than ListT for that? So far, we seem to agree that most
practical
Magnus Therning wrote:
There is support for darcs in tracs as well.
Gour wrote:
I was playing with it in the past, but it's 3rd party,
ie. Trac does not have official support.
I happen to be looking for a project mgmt framework
right now.
It seems to me that the opposite is true. Trac is a
John Meacham wrote:
if anyone is interested, Although I bet this has been implemented a
hundred times over, I have attached my lazy naturals module below just
for larks.
Nice, lots of fun!
Wouldn't it be more convenient to allow them
to be signed? True, you can't have laziness in
certain
Tim Newsham wrote:
A tutorial on the Curry-Howard Correspondence in Haskell:
http://www.thenewsh.com/%7Enewsham/formal/curryhoward/
Nice!
Perhaps you should add a link to this on the wiki:
http://haskell.org/haskellwiki/Curry-Howard-Lambek_correspondence
Thanks,
Yitz
Dougal Stanton wrote:
It's just occurred to me that answering questions like these is a bit
like the prisoner's dilemma...
There's no way to win! :-)
Yes there is. Just mention the following wiki page
as part of your answer:
http://haskell.org/haskellwiki/Homework_help
-Yitz
Peter Verswyvelen wrote:
However, I suspect the experts here will be able to make that much
shorter and more efficient (maybe using Data.Map?)
That makes it difficult to respond. I am definitely not
claiming to be an expert. For one thing, my name
is not Simon. But I'll say something anyway,
I wrote:
When you can assume Ord, the standard solution
is, as you suggest, something like...
Oops, sorry, doesn't typecheck. Here it is corrected:
import qualified Data.Map as M
import Data.List
histogram = M.toList . foldl' (\m x - M.insertWith' (+) x 1 m) M.empty
This should work
Is there a place where one can look up the complexity of Standard
Libraries functions ?
No. Some modules have it in their Haddock docs.
Most don't.
But the source code is available. :)
-Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi Chad,
Chad Scherrer wrote:
I think the stack overflows
were happening because Map.insertWith isn't strict enough.
Otherwise I think the code is the same.
They are visibly almost identical - except that you
do an extra lookup to get your strictness, while insertWith'
has internal access and
I wrote:
Nice, lots of fun!
Wouldn't it be more convenient to allow them
to be signed?
John Meacham wrote:
Well, a couple reasons. One is that Natural numbers are a pretty useful
type in and of themselves, often times when used with lazy evaluation.
The other is that it is unclear what
Hi John,
I wrote:
- Zero really means 0, not 0 or negative
You wrote:
Actually, zero does mean zero. There is no such thing as negative
numbers in the naturals so it doesn't make sense to say '0 or negative'.
Well, then, 0 or error, or 0 or nothing. It clearly
does not mean zero.
I wrote:
Yitzchak Gale wrote:
So why not make the laziness available
also for cases where 1 - 2 == 0 does _not_ do
the right thing?
data LazyInteger = IntZero | IntSum Bool Integer LazyInteger
or
data LazyInteger = LazyInteger Bool Nat
or whatever.
Luke Palmer wrote:
data LazyInteger
Maxime Henrion wrote:
This version takes care of avoiding a redundant character check
It still has several redundant checks:
s'' is known to begin with space if it is non-empty,
but that is checked again in the recursive call
of wordsBy. In fact, break already checked whether
s'' is empty, but
Neil Mitchell wrote:
You are still over by one test. Try instead:
wordsBy :: (a - Bool) - [a] - [[a]]
wordsBy p s = case dropWhile p s of
[] - []
s':rest - (s':w) : wordsBy p (drop 1 s'')
where (w, s'') = break p rest
This still has the redundant empty list tests,
and
Neil Mitchell wrote:
...Also remember that
p may be arbitrarily expensive, while a test for an empty list is
cheap. In the particular case of words, p (i.e. isSpace) is very
expensive...
A reasonable level of optimisation for this function would be that the
predicate is invoked at most once
Henning Thielemann wrote:
HXT uses Parsec, which is strict.
Is is strict to the extent that it cannot produce any
output at all until it has read the entire XML document?
That would make HXT (and Parsec, for that matter)
useless for a large percentage of tasks.
Or is it just too strict in
Malcolm Wallace wrote:
HaXml now uses the polyparse library, and you can choose whether you
want well-formedness checking with the original strict parser, or lazy
space-efficient on-demand parsing. Initial performance results show
that parsing XML lazily is always better than 2x as fast, and
Another question about HaXML and HXT -
what is the level of XML spec. compliance?
The many who have tried to implement compliant
XML parsers in various languages - and the few
who have succeeded - all agree that this is much
harder than it seems at first.
Most of the time, the final result is an
Magnus Therning wrote:
My collection of data encoding functions are now available
Nice!
Should this effort be coordinated with Unicode-related
encoding/decoding? See the Encoding class in
Twan van Laarhoven's CompactString library:
http://twan.home.fmf.nl/compact-string/
and Johan Tibell's
Malcolm Wallace wrote:
I have been considering moving the lexer to use
ByteString instead of String, which would neatly solve that problem too.
Doesn't the lexer come only after decoding?
Then you have Unicode. Does ByteString still help?
-Yitz
___
Duncan Coutts wrote:
I'm very happy to get feedback on the API, the documentation or of
course any bug reports.
It would be nice if the API could be the same for all
character and data codecs.
Thanks,
Yitz
___
Haskell-Cafe mailing list
Hi Alex,
You wrote:
I'm new to Haskell, and don't quite understand how IO and lazy
evaluation work together yet. In order to improve my understanding, I
thought I'd try to knock together a translation of a fairly simple
problem I can code up in C...
Now, I have two questions. The easy
Hi Alex,
I think I would have avoided most of the problems
in the first place. I'm finding the documentation
to be rather undiscoverable at the moment, but I'm
sure it's just a question of learning my way around it.
Make sure to keep
http://haskell.org/ghc/docs/latest/html/libraries/
on
I wrote:
There is still a problem here - my code (and also
all of the previous posters, I think) clobbers the random
generator, rendering it unusable for future calculations.
In this case that is probably not a problem, but it
is a bad habit to get into, and not very polite.
Jonathan Cast
Paul Johnson wrote:
The Haskell home page hasn't been updated since 23rd September, even
though a Haskell Weekly News came out on October 25th.
Not to mention GHC 6.8.1.
-Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
rabbit = 1 : concatMap ((0:) . flip replicate 1 . (1+)) rabbit
This nasty acquaintance of mine...
demanded the solution (in Haskell) as a one-liner.
It wasn't you yourself, was it?
No. Please, tell me it isn't so.
Regards,
Yitz
___
Haskell-Cafe
Hi Ryan,
You wrote:
I've attempted to cut down this module... but I cannot see where... can
someone help...
You don't need wordToInt - just use read instead.
Look at the type of the function map in the Prelude -
you can use it to get rid of method and test.
After that, your program will be
Hans van Thiel wrote:
If you mean that people should not do arithmetic
on computers, if the results are vital, unless they understand the scope
and limits of the tools they're using, I agree, of course.
My brother used to work for a certain well-known
manufacturer of CPUs. He told me that the
Hi Chris,
You wrote:
If you wanted to write a Haskell application that included a WYSIWYG
HTML editor, how would you do it?
I would use fckeditor.
Why do you need to write an HTML editor from scratch
in Haskell? That is a very, very big wheel to re-invent.
Regards,
Yitz
I was also bitten by this. I consider it to be a
serious problem with the UI for ghci.
My vote is:
o The default should be to make all symbols available
whenever possible.
o It should be easy for experts, like Aaron Denney,
to get the current behavior. (E.g., a flag, that can
be turned on or
Wouter Swierstra wrote:
I am pleased to announce that a new issue of The Monad.Reader is now
available:
http://www.haskell.org/haskellwiki/The_Monad.Reader
Dougal Stanton wrote:
Thanks Wouter, the haiku look great! ;-)
I agree, they are fantastic! (And they are not short.)
Perhaps you
Bit Connor wrote:
Also, a related question: How do you convert from Float - Double, and
the reverse? Only thing I could find is (fromRational . toRational)
which I also imagine to be slow, and I also wonder about accuracy.
realToFrac
-Yitz
___
Andrew Coppin wrote:
On the other hand, I must relay to you how much fun I had with certain
other problems.
You may want to look at:
http://haskell.org/haskellwiki/Euler_problems
and make some contributions. But be very careful
what you peek at, so don't spoil your own fun.
Regards,
Yitz
lemming wrote:
Python page could start with: You like 'map', 'filter', 'for x in ...'
and lambda's in Python? Then you will like to learn where Python has
What about iterators - lazy lists - and generators - lazy
function definitions. And list comprehensions, both lazy
and strict. And zip. And
Bit Connor wrote:
computation is. And since it's all calls to map and filter et al., it's
...it's not immediately clear how to provide any feedback
on how much longer there is to wait.
Andrew Coppin wrote:
It seems unsafePerformIO is the way to go here.
...unsafeInterleaveIO
I disagree. The
Adrian Neumann wrote:
data Tree a = Leaf a | Node a [Tree a]
example: given a tree t and two nodes u,v, find the
first common ancestor. In Java this is really simple,
because each node has a parent reference...
In Haskell however the best way I've come up with so
far is doing a BFS and
Jules Bean wrote:
I think the 'right' answer for this case is to drop the maybes and just
use lists, which is what the OP himself realised.
Yes, part of the fun of programming is when
you realize that you have been re-implementing the
right data type inside of a wrong one.
Alistair Bayley
Luis Cabellos wrote:
I have a question, what's the best way to program?
- put all the signatures in the Haskell Code?
- Only put the type signatures needed to compile (like monomorphism errors
or ambiguous signature)?
Wolfgang Jeltsch wrote:
Inserting all type signatures is definitely best
Simon Peyton-Jones wrote:
Given instance C T where ..., for any method 'm' not
defined by ...:
for every class D of which C is a superclass
where there is an instance for (D T)
see if the instance gives a binding for 'm'
If this search finds exactly one
Hi Bulat,
You wrote:
please help me with selection of proper function to use
i need to run external command with parameter and get its stdout, smth
like this:
output - system cmd param
the code should be compatible with unix and windows, and it should be
possible to execute scripts (so afaiu
so,
do (stdin,stdout,stderr,ph) - runInteractiveCommand script param
waitForProcess ph
when i should read stdout? before or after waitForProcess?
If you are sure that your script will behave nicely
(or don't care if it doesn't), how about just:
(_, h, _, _) - runInteractiveCommand script
Bulat Ziganshin wrote:
to Yitzchak: and you've asked what's wrong with runInteractiveCommand? :)))
It was a good question. It prompted Duncan to
post some really cool stuff, and we all learned
something.
-Yitz
___
Haskell-Cafe mailing list
Bulat Ziganshin wrote:
...are there any objections against...
(_, h, _, _) - runInteractiveCommand script params
output - hGetContents h
taking into account that bad-behaved scripts are not my headache?
bad-behaved scripts are not my headache is not the same
as behave nicely. Or I guess
(_,h,e,_) - runInteractiveCommand script params
clearStderr
output - hGetContents h
where clearStderr is one of:
1. hClose e
2. hGetContents e = evaluate . last
3. forkIO (hGetContents e = evaluate . last return ())
all seem to work for me on Mac OS. Only 2 hangs on
Debian testing. What
Ah, good old seq. How I loathe it.
Seriously, though, good catch. I always forget about seq when I'm doing
stuff like this.
When using seq and _|_ in the context of categories,
keep in mind that Haskell composition (.)
is not really composition in the category-theoretic
sense, because it adds
I wrote:
(.!) f g x = f `seq` g `seq` f (g x)
Roberto Zunino wrote:
id .! undefined
== \x - undefined
/= undefined
Probably you meant
(.!) f g = f `seq` g `seq` (f . g)
Yes, thank you.
-Yitz
___
Haskell-Cafe mailing list
Derek Elkins wrote:
There is another very closely related adjunction that is less often
mentioned.
((-)-C)^op -| (-)-C
or
a - b - C ~ b - a - C
This gives rise to the monad,
M a = (a - C) - C
this is also exactly the comonad it gives rise to (in the op category
which ends up being the
Simon Peyton-Jones:
Would someone familiar with the command-line-parsing libraries
care to help Krassimir?
I agree with Max that it looks like the problem is
not doing any fancy command-line parsing
(if that is indeed the issue, then please post more
information about what the problem is).
Hi Konstantin,
Here is yet another possible approach:
Perhaps you really meant what you wrote in your definition
of firstFunction - namely, that it needs to be polymorphic,
so that it can convert to _any_ type that is an instance
of SecondClass.
In that case, you might want to add another
Hi Cristian,
Cristian Baboi wrote:
While reading the Haskell language report I noticed that function type is
not an instance of class Read.
I was told that one cannot define them as an instance of class Show
without breaking referential transparency or printing a constant...
How can I define
Cristian Baboi wrote:
http://en.wikipedia.org/wiki/First-class_object
I'll guess that 5,9,12 does not apply to Haskell functions.
I think there is a basic semantic difference between
what the author of that article meant by the word
function and what we mean by that word when
we are talking
Cristian Baboi wrote:
I think I found the answer to why functions cannot be written to files.
This is by design. Haskell must be free.
Enabling writing functions to files, might make it ilegal in some
countries. :-)
Ha, excellent!
I imagine that is what Haskell must have been
like before
Cristian Baboi wrote:
Ah! You must have been thinking that function in Haskell are members of
DATA types.
Or, to put it another way, Haskell make no distinction between data types
and function types.
Yes.
I wrote:
Like any type, only certain operations make
sense on functions...
Yes, but
Wolfgang Jeltsch wrote:
If x doesn't equal y, x == y is False, but if x
equals y, x == y might be True or undefined.
apfelmus wrote:
x == y may be _|_ for the False case, too, depending on its
implementation (like first comparing all list elements on even indices
and then comparing all list
Andrew Bromage wrote:
[*] Theoretical nit: It's not technically a set.
Consider the data type:
data Foo = Foo (Foo - Bool)
This declaration states that there's a bijection between the elements of
Foo and the elements of 2^Foo, which by Cantor's diagonal theorem cannot
be true for any
Andrew Bromage wrote:
[*] Theoretical nit: It's not technically a set.
Consider the data type:
data Foo = Foo (Foo - Bool)
This declaration states that there's a bijection between the elements of
Foo and the elements of 2^Foo, which by Cantor's diagonal theorem cannot
be true for any
Hi Jonathan,
I wrote:
So in what way are Set morphisms restricted from being
Hask morphisms?
Jonathan Cast wrote:
The normal view taken by Haskellers is that the denotations of
Haskell types are CPPOs.
CPPO?
So:
(1) Must be monotone
(2) Must be continuous
Could you please define what
Hi Benja,
I wrote:
By the type expression Integer - Integer
we mean all Haskell functions mapping Integers to Integers.
There are only countably many of those.
...
But that was not the context in this thread. The category
Hask that we often mention in discussions about Haskell
the
Jonathan Cast wrote:
The normal view taken by Haskellers is that the denotations of
Haskell types are CPPOs.
I wrote:
CPPO?
(1) Must be monotone
(2) Must be continuous
Could you please define what you mean by those terms
in this context?
Jens Blanck wrote:
The extra P would stand for
Peter Verswyvelen wrote:
Looks good! I liked relational algebra much much more than SQL, so I'll
certainly have to look into that.
I agree. I have not tried haskelldb yet, but I would
like to.
My impression from some previous posts is that
because of the high-level approach, it is difficult
I wrote:
... to control the precise SQL that is generated. In practice,
you almost always have to do some tweaking that is
at least DB-dependent, and often application dependent.
Peter Verswyvelen wrote:
Can't the same be said regarding SQL itself? It sometimes needs tweaking.
That's the
Lihn, Steve wrote:
For small queries, it does not matter much which approach you choose.
But for large, complex queries, such 3-table join (especial Star
Transformation) and/or large data set (millions of rows involved in
large data warehouses), the performance will differ by order of
Jonathan Cast wrote:
The normal view taken by Haskellers is that the denotations of
Haskell types are CPPOs.
So:
(1) Must be monotone
(2) Must be continuous
(Needn't be strict, even though that messes up the resulting
category substantially).
I wrote:
I'm not convinced that the category
I wrote:
What goes wrong with finite coproducts? The obvious thing to
do would be to take the disjoint union of the sets representing the
types, identifying the copies of _|_.
Jonathan Cast wrote:
This isn't a coproduct. If we have f x = 1 and g y = 2, then there
should exist a function h
(sorry, I hit the send button)
What is the lifted version you are referring to?
Take the ordinary disjoint union, and then add a new _|_ element,
distinct from both existing copies of _|_ (which are still distinct
from each other).
Now why is that not the category-theoretic coproduct?
h .
I wrote:
...it was recently claimed on this list that tuples
are not products in that category.
Derek Elkins wrote:
Johnathan has given such a demonstration (and it has been demonstrated
many times on this list since it's creation, it's well-known).
We're still working on it. I've not been
Galchin Vasili wrote on Friday, January 4:
I stumbled across this page. It seems that Haskell and other
strongly typed functional languages like Ml/OCaml will fare much,
much better, e.g. buffer overrun. Thoughts . comments.
Bulat Ziganshin wrote:
for me, it looks like saying that
Mitar wrote:
Why is 0/0 (which is NaN) 1 == False and at the same time 0/0 1 ==
False. This means that 0/0 == 1? No, because also 0/0 == 1 == False.
I understand that proper mathematical behavior would be that as 0/0 is
mathematically undefined that 0/0 cannot be even compared to 1.
Cristian Baboi wrote:
and there is no such thing as the same bottom right ?
Yes and no. Semantically, every bottom is the same.
However, the Haskell Report makes bottom an explicit
exceptional case. Compilers are allowed to do whatever
they want with bottoms, including different results for
Cristian Baboi wrote:
and there is no such thing as the same bottom right ?
I wrote:
Yes and no.
Semantically, Yes and No is bottom ?
Yes and no.
-Yitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Cristian Baboi wrote:
I think this should be put this way:
Bottom is a part of the semantic domain which is not Haskell.
Rather, something outside Haskell that describes
what Haskell programs mean. Yes.
In the semantic domain there is one bottom.
In Haskell there are many expressions that
I wrote:
Like nearly all programming languages, Haskell implements
the standard IEEE behavior for floating point numbers.
That leads to some mathematical infelicities that are
especially irking to us in Haskell, but the consensus was
that it is best to follow the standard.
Jules Bean wrote:
Jian Fan wrote:
I somehow cannot figure this out. Tree is Foldable so I
can use find on it. But how can I use find on TreeLoc?
Am I missing something obvious?
But what exactly is a TreeLoc? Hoogle doesn't know about
it. If you created it yourself, you haven't showed us
how you defined it or
Henning Thielemann wrote:
Is NumLazyByteString a newtype around Bytestring.Lazy
that interprets the bit stream represented by the ByteString
as integer?
Thomas DuBuisson wrote:
Not exactly. There is not newtype wrapper. NumLazyByteString is:
instance Num L.ByteString where
...
Are you
Andrew Coppin wrote:
I just uploaded a new version of the AC-Colour package...
Thanks for this.
Your algorithm for scaling brightness is not correct however.
The RGB values in all popular image formats are not linear.
They use a gamma transfer function. So your algorithm
will indeed change the
Jian Fan wrote:
Following is what I have for now...
Oh, nice! That is simpler. Now we can do:
searchTree pred rootLoc
| pred (getLabel rootLoc) = Just rootLoc
| otherwise = search right `mplus` search firstChild
where
search next = next rootLoc = searchTree pred
Regards,
TeXitoi wrote:
why is foldl used by Data.List for sum?
Daniel Fischer wrote:
Because Haskell is a non-strict language, and foldl' is strict -- someone
might write a (legitimate) Num instance for a datatype such that
foldl (+) 0 xs returns a good value, but foldl' (+) 0 xs gives
***Exception:
Daniel Fischer wrote:
I'm not sure whether it's a wart or a bug, but I agree that it would be
better to have the default sum strict
David Leimbach wrote:
That would be really inconsistent with the way the rest of the Haskell
language and libraries works...
I would propose that... sum be
Louis Wasserman wrote:
I just released a package, th-kinds, which attempts to automatically infer
the kind of a specified type, type constructor, type family, type class, or
pretty much anything else that has a kind...
It rolls its own kind inference...
Interesting.
The right way to do this
Stephen Tetley wrote:
LilyPond has already answer this one...
trying for a typed
representation would be too restrictive - LilyPond has a very large
LaTeX style syntax for assembling scores.
I find LilyPond's very monolithic very stateful representation
to be ugly and awkward. It clearly
1 - 100 of 500 matches
Mail list logo